If you check carefully,i think you'll find the sub-activities get
constructed immediately, but onCreate doesn't get called until the tab
gets selected. My guess: get the code out of your constructor (it
doesn't belong there anyway) and you'll get what you want. I had to
deal with the opposite problem -- code that expected other tabs to
have been previously onCreated -- so I'm pretty certain that's the way
it works


On Dec 2, 8:38 am, pedr0 <[email protected]> wrote:
> Hi at all,
>
> I develop an Tab based application, and I add activity in my tab in
> this way:
>
> mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("TAB
> 1").setContent(intent1));
> mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("TAB
> 2").setContent(intent2));
> mTabHost.addTab(mTabHost.newTabSpec("tab_test4").setIndicator("TAB
> 3").setContent(intent3));
> mTabHost.addTab(mTabHost.newTabSpec("tab_test5").setIndicator("TAB
> 4").setContent(intent4));
>
> mTabHost.setCurrentTab(1);
>
> where mTabHost is an object of TabHost  type.
>
> I discovered that this way start ALL intents at the same time!
>
> I have some issues in my code or exists a way to configure TabHost to
> start new intent when user click on a Tab?
>
> Thanks a lot.
>
> pedr0

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to