actually, i was mistaken. onCreate() for all the added tabs is called. considering, it seems less likely that there's a solution ... i'd like to only call onCreate() for the selected tab.
On Sat, Oct 3, 2009 at 9:43 PM, Jeffrey Blattman <jeffrey.blatt...@gmail.com > wrote: > i have a tab host that saves the last selected tab into a preference, and > loads it again in onCreate(). i add the tabs to the tab host through an > intent, such as, > > > mTabHost.addTab(mTabHost.newTabSpec("closest").setIndicator("Closest", > > getResources().getDrawable(R.drawable.location)).setContent( > new Intent(this, ClosestActivity.class))); > > the problem is that i only want the onCreate() method of the selected tab > to be called. however, the onCreate() method of the first tab added through > addTab() is always called, regardless of the selected tab. i figure this is > happening because i'm calling addTab() before i've called setCurrentTab(). > since there's no selected tab set when i call addTab(), it assumes it's the > first one added. > > assuming i'm correct there, is there a way to delay the tab host's > "initialization" of the selected tab, until i can set it manually? or maybe > i'm missing some other sublety. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---