I have a problem with TabHost...
I have TabBarActivity class flow as :
public class TabBarActivity extends TabActivity implements OnTabChangeListener{
/*
* (non-Javadoc)
*
* @see android.app.ActivityGroup#onCreate(android.os.Bundle)
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.layout_tab);
TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost);
TabSpec mTab1 = tabHost.newTabSpec("tab1");
TabSpec mTab2 = tabHost.newTabSpec("tab2");
mTab1.setIndicator("TAB1").setContent(
new Intent(this, TAB1.class));
mTab2.setIndicator("TAB2").setContent(
new Intent(this, TAB2.class));
/** Add tabSpec to the TabHost to display. */
tabHost.addTab(mTab1);
tabHost.addTab(mTab2);
}
And I have ListView ( such as Contact name ) inside TAB1.java class
Assume : I have a screen layout with 2 tab on bottom ( TAB1, TAB2 ). When I click TAB1 , I have a contact name list and if I click on itemList. The detail screen of ItemList will open. And inside "DetailScreen" layout , i want to keep the (TAB1, TAB2) tabhost on bottom screen.
Now,when I run a application and click itemList . I don't keep the tabhost ( TAB1, TAB2 ) in DetailScreen of each item list...
How to keep it when I start Activity of item list ( such as : DetailScreen.java )
Thanks you
@ all : thanks for your feedback but it seem that you doesn't understand my problem.
My problem : Detail my project : 1- I have some Class: + TabBarActivity.java ( source code flow as above , top page, it have 2 tab on bottom layout Tab1, Tab2.... Default forcus Tab1 when run application) + Tab1.java ( Important : in this class , I have listview ( such as youtube on phone) , when I click one item on List -> open the detail screen for each Item of List... OK ) + Tab2.java ( do something...)
2 - When I run apps , you see 2 Tab on bottom layout and default startActivity Tab1.java -> then show listview in this screen... And when click one item of List -> open detail screen of this item (StartActivity DetailItem.java) -> But 2 Tab on bottom will be disappear....
I don't known why ????
Please help me :((