Hi all
I need to be able to change the icon on a tab when it is selected, and
change it back when it is deselected. How would I go about doing this?
I have this code so far:
[code]
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabs = (TabHost)this.findViewById(R.id.tabs);
tabs.setup();
TabHost.TabSpec one = tabs.newTabSpec("one");
one.setContent(R.id.content1);
one.setIndicator("Shoutbox", this.getResources().getDrawable
(R.drawable.sound_36));
tabs.addTab(one);
TabHost.TabSpec two = tabs.newTabSpec("two");
two.setContent(R.id.content2);
two.setIndicator("Forum", this.getResources().getDrawable
(R.drawable.document_36));
tabs.addTab(two);
TabHost.TabSpec three = tabs.newTabSpec("three");
three.setContent(R.id.content3);
three.setIndicator("PM's", this.getResources().getDrawable
(R.drawable.lock_36));
tabs.addTab(three);
tabs.setCurrentTab(1);
}
@Override
public void onTabChanged(String arg0)
{
if (arg0 == "content2")
{
TabHost tabs = (TabHost)this.findViewById(R.id.tabs);
}
}
[/code]
Thank you!
Vista06
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---