以片段代码加载活动 [英] Loading activity in Fragment Code
本文介绍了以片段代码加载活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以在片段中加载活动(特别是在onCreateView中)吗?除了通过充气器创建视图之外,我们还可以启动活动,以便调用其事件吗?
Can we load an activity (specifically in onCreateView) in fragment ? Instead of creating view by inflater, can we launch activity so it's events gets called ?
例如
代替使用"inflater.inflate(R.layout.tabactivity,null)",我们可以启动使用"tabactivity"作为布局的活动吗?
Instead of using "inflater.inflate(R.layout.tabactivity, null)", can we launch activity which uses "tabactivity" as layout ?
推荐答案
不可能无法在fragment
内添加Activity
.
Fragment
是Activity
的UI组件的一部分.
It's not possible you cannot add Activity
inside a fragment
.
Fragment
is part of UI component of Activity
.
请参阅下面的链接
这篇关于以片段代码加载活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文