How to get TabHost
I am doing application with TabHost activity. I have 5 different class in that 4 class inserted into TabHost view. In one particular class i have list view with onItemclicklistener. while clicking the list view, it goes to different activity(ie 5th class). I want t开发者_如何学运维o place the clicked activity in TabHost. (ie) whenever i click the list view, the calling activity should appear in TabHost.But now it appears without tab host. i want to place Tab host in 5 th class by clicking listview. I dont know how to do this, if any one having idea pls let me know and guide me how to do this.
host= (TabHost)findViewById(android.R.id.tabhost);
host.setup();
TabHost.TabSpec spec;
// Create an Intent to launch the first Activity for the tab (to be reused)
Intent i = new Intent().setClass(this, library.class);
spec = host.newTabSpec ("FirstGroup").setIndicator("Library",getResources().getDrawable(R.drawable.imagename)).setContent(i);
host.addTab(spec);
u have to add your all activity like this(here Library)
精彩评论