As expected pulling the HTTP work off of the UI thread fixed the speed problem. It still doesn't make sense to me why an orientation change always loads the first activity in a TabHost hosting activities, regardless of which tab you are in (see above). If anyone has any idea what is going on or what I'm missing here let me know.
On Nov 24, 11:43 am, droid_does <[email protected]> wrote: > I currently have aTabHostwith 3 tabs. The content of each tab is an > activity. The first and second tab make HTTP connections. The first > tab still uses the UI thread (which i'm changing) so it would explain > thesloworientationchange since it's creating a fresh activity and > making all those connections again. What I don't understand is why if > I am on say Tab 3 which makes no connections at all does changing > theorientationtake such a long time (up to 5 seconds). > > In playing around with the TabWidget I noticed something that may be > related. > > So let's say we have an activity with aTabHost, with Activities as > content: > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > > mTabHost = getTabHost(); > > mTabHost.addTab(mTabHost.newTabSpec("tab_test1").setIndicator("TAB > 1").setContent(new Intent(this, Activity1.class))); > mTabHost.addTab(mTabHost.newTabSpec("tab_test2").setIndicator("TAB > 2").setContent(new Intent(this, Activity2.class))); > mTabHost.addTab(mTabHost.newTabSpec("tab_test3").setIndicator("TAB > 3").setContent(new Intent(this, Activity3.class))); > > } > > Activity 1, 2, and 3 simply Toast a message that says which activity > they are. Activity 2 says "I am Activity 2" > > If I am in Tab 1 and changeorientationI will get the message for > just Activity 1 as expected, however if I am in Tab 2 or Tab 3 and > change theorientationI will first get a message from Activity 1 and > then 2 or 3 depending on which I'm in. > > Why does this happen? Is there a better way to use tabs with > activities that I've overlooked? > > Thanks -- 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

