Android : passing parameters to a tab

断了今生、忘了曾经 提交于 2019-12-05 06:31:03

The answer is yes. the parameters you are passing in this Bundle are later set as your fragment arguments and can be accessed with getArguments from inside the fragment.

The code that makes it happen in the FragmentTabHost is :

newTab.fragment = Fragment.instantiate(mContext,
                        newTab.clss.getName(), newTab.args);

Looking at the FragmentTabHost.java,looks like it passes this bundle to the tabinfo,which inturn has the fragment.So the answer is yes !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!