【发布时间】:2010-11-08 11:55:39
【问题描述】:
我正在尝试为我的 android 应用程序设置一些选项卡,但我卡住了。
我找不到在选项卡之间进行通信的方法..
我有 2 个标签。
|搜索|结果|
搜索选项卡只是显示一个文本编辑和一个“搜索”按钮。 点击搜索按钮应该会使我的应用更改为结果选项卡并显示结果。
我已将选项卡添加为活动,使用新意图作为
TabHost host=getTabHost();
host.addTab(host.newTabSpec("one")
.setIndicator("Search")
.setContent(new Intent(this, SearchTabActivity.class)));
host.addTab(host.newTabSpec("Result")
.setIndicator("Android")
.setContent(new Intent(this, ResultTabActivity.class)));
现在我找不到 SearchTabActivity 显示 ResultTabActivity 并更改其视图的方法...
我期待任何提示。
【问题讨论】:
-
我推荐使用 SearchManager:developer.android.com/reference/android/app/SearchManager.html
-
我建议不要将活动用作标签内容。
标签: android user-interface android-activity tabs