How to change view from tab view to normal view in android
How can we enter from Tab view to normal view in android.After clicking a tab we need to en开发者_如何学Pythonter in the next view which don't need to have tab bar.
set listener to the tab.In the listener start new activity
tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener()
{
// @Override
public void onTabChanged(String arg0)
{
if(arg0.equals("tabname"))
{
Intent intent=new Intent(Activityname.this,newactivityname.class);
startActivity(intent);
}
}
});
where tabhost is the object of TabHost and Activityname is the name of your activity,tabname is the name of your tab
Well the whole point of a tab view is that you can click the tab and it will have some data in it then click another it will have other data. If you click the tab and it brings you to a new screen then its a waste of time using a tab view just create 3 buttons which launch a new intent. Perhaps im reading the question wrong. In any way here is a helpful guide for setting up a tab view in android you can mess with this a bit to get what you want.
http://nerdburglars.net/tutorial.php?ID=8
精彩评论