问题描述
我有TabHost ...
I have a problem with TabHost...
我有TabBarActivity类流程为:
I have TabBarActivity class flow as :
公共类TabBarActivity扩展TabActivity实现OnTabChangeListener {
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);
}
和我有ListView控件(如联系人姓名)TAB1.java类中
And I have ListView ( such as Contact name ) inside TAB1.java class
假设:我有一个带2个选项卡上的底部(TAB1,TAB2)屏幕布局。当我点击TAB1,我有一个联系人名单,如果我点击ITEMLIST。 ITEMLIST的细节画面将打开。而里面的DetailScreen的布局,我想保持(TAB1,TAB2)tabhost底部的屏幕上。
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.
现在,当我运行一个应用程序,并单击ITEMLIST。我不守tabhost(TAB1,TAB2)中的每个项目列表DetailScreen ...
Now,when I run a application and click itemList . I don't keep the tabhost ( TAB1, TAB2 ) in DetailScreen of each item list...
如何保持它,当我启动项目列表活动(如:DetailScreen.java)
How to keep it when I start Activity of item list ( such as : DetailScreen.java )
谢谢你
@所有:感谢您的反馈,但它似乎是你不理解我的问题。
@ all :thanks for your feedback but it seem that you doesn't understand my problem.
我的问题:详细信息我的项目:1 - 我有一些类:+ TabBarActivity.java(来源$ C $ C作为上述流程,首页,这对底部布局TAB1,TAB2 2标签....默认forcus TAB1运行应用程序时)+ Tab1.java(重要:在这个班,我有列表视图(如YouTube上的电话),当我点击一个项目的列表 - >打开详细资料屏幕列表中的每个项目...好 )+ Tab2.java(做某事)
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 - 当我运行的应用程序,你看到底部的 2标签的布局和默认startActivity Tab1.java - >然后显示在列表视图此屏幕...当点击列表中的一个项目 - >这个项目(StartActivity DetailItem.java)的开放细节画面 - > 但是2选项卡下会消失 ...
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 see below link for that may be it will solve your problem and if you have any query regarding that then tell me.
这篇关于如何保持Tabhost时启动其他活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!