【发布时间】:2012-12-28 12:09:04
【问题描述】:
使用 TabHost 和 TabWidget 我在 android 中创建了两个选项卡,第二个选项卡的问题是它必须显示带有图像的列表视图。 所以我使用了这里给出的想法http://wptrafficanalyzer.in/blog/listview-with-images-and-text-using-simple-adapter-in-android/
所以我的 tab2 指的是该链接中给出的 mail.xml。如何从 tab2 调用 mainactivity.java 以便显示列表的内容?
.//tab 1 contents
.
TabSpec spec2 = tabHost.newTabSpec("Categories");
spec2.setIndicator("Categories",
getResources().getDrawable(R.drawable.ic_menu_categories));
spec2.setContent(R.id.main);
.
.
在这里,我需要调用使用简单适配器创建该列表视图的类。我怎么做? 请回复
【问题讨论】:
-
仅供参考 tab2 内容在 xml 中。因此,我将该 tag2 id 命名为 main。所以 R.id.main 是有效的..
标签: android android-layout android-intent android-tabhost