[android-developers] Re: starting Activity in tabbed UI from onTabChangedListener()
Please don't use Activities as tab panes. You are just setting
yourself up for all kinds of grief now and in the future. And since
this is deprecated, you will never see the many outstanding bugs
fixed.
If you must, refactor your code so that you can just use a View. I
know that can be painful, I've done it, but you are doing yourself a
favor, trust me.
On Jul 24, 5:13 pm, Marcin Orlowski <webnet.andr...@gmail.com> wrote:
> Hi
>
> I got tabbed UI, where I use own tab layout by utilising
> TabSpecs.setContent() to provide custom layout. As I wanted tab content to
> be Activites not Views, I set onTabChangedListener() to do the job, with no
> much success:
>
> public class MainActivity extends TabActivity {
> .... onCreate() {
>
> mTabHost = (TabHost)findViewById(android.R.id.tabhost);
> mLocalActivityManager = getLocalActivityManager();
> mTabHost.setup(mLocalActivityManager);
>
> }
> }
>
> and listener:
>
> public void onTabChanged(String tag) {
> intent = new Intent().setClass( context, NextActivity.class);
> mLocalActivityManager.startActivity(tag, intent);
>
> }
>
> Listener's onTabChanged() is called, but nothing else happens, nor crashes,
> nor logs. Hints?
>
> PS: I also failed to follow reasoning why seting intent (so the content tabs
> points to) equals setting view of tab itself (it all falls under
> ContentStrategy in TabHost).
> PPS: Fragments, I know, I know.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home