I could still use some help on this issue.
Here's my tab layout:
tabs.setup();
TabHost.TabSpec spec=tabs.newTabSpec("tab1");
spec.setContent(R.id.tab1);
spec.setIndicator("text1",this.getResources().getDrawable(R.drawable.icon1));
tabs.addTab(spec);
spec=tabs.newTabSpec("tab2");
spec.setIndicator("text2",this.getResources().getDrawable(R.drawable.icon2));
spec.setContent(R.id.tab2);
tabs.addTab(spec);
spec=tabs.newTabSpec("tab3");
spec.setIndicator("text3",this.getResources().getDrawable(R.drawable.icon3));
spec.setContent(R.id.tab3);
tabs.addTab(spec);
spec=tabs.newTabSpec("tab4");
spec.setIndicator("text4",this.getResources().getDrawable(R.drawable.icon4));
spec.setContent(R.id.tab4);
tabs.addTab(spec);
tabs.setCurrentTab(tabNumber);
What I was trying is throwing in something like this to catch the
current tab number:
tabs.setOnTabChangedListener(new OnTabChangeListener(){
public void onTabChanged(String tab1) {
// TODO Auto-generated method stub
tabNumber = tabs.getCurrentTab();
}
});
And then hoping that it would retain that information when changing to
landscape or back again to portrait. However, this isn't working.
Any insight would be greatly appreciated.
On Oct 23, 12:02 pm, "Jeremy G" <[EMAIL PROTECTED]> wrote:
> Oh, ok...thanks for the info. Are you aware of any way to cope with this so
> that it maintains tab selection?
>
> On Oct 23, 2008 9:03 AM, "for android" <[EMAIL PROTECTED]> wrote:
>
> The activity gets restarted by the process of switching the land
> scape..Thats the reason .. you are facing this problem....
>
> On Wed, Oct 22, 2008 at 8:44 PM, atrus123 <[EMAIL PROTECTED]> wrote: > > >
>
> So I've started debugg...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---