【发布时间】:2013-09-26 13:23:17
【问题描述】:
我想与 FragmentTabHost 中的片段通信
通讯片段->活动完成!带接口。
但是我无法创建通信Activity->Fragment,因为我创建了这样的Fragment:
mTabHost.addTab(
mTabHost.newTabSpec("tab2").setIndicator("Affichage",
getResources().getDrawable(android.R.drawable.star_on)),
MySelectionFragment.class, null);
MySelectionFragment 是一个类,而不是像 new MySelectionFragment() 这样的片段
我不知道如何与班级交流:/
提前致谢!
【问题讨论】:
-
我在
TabHost中找不到任何方法作为addTab(TabSpec, Class, ????)。你说你用了什么方法? -
我也没有。我在答案中找到了它:stackoverflow.com/questions/17227855/…
-
...您实际上使用的是
FragmentTabHost。请在发布问题时具体说明。不要把人们引向另一个方向。
标签: android android-fragments android-tabhost