我试图调用从活动使用意图片段类。是否有可能实现。请提供您的意见。
I am trying to call a Fragment class from Activity using Intent. Is it possible to implement. Please provide your views.
片段
需要举办一个 FragmentActivity
,你可以做一个意图
来从活动
调用片段。
Fragment
needs to be hosting by a FragmentActivity
, you can make a Intent
to call a fragment from an Activity
.
您需要创建一个 FragmentManager
添加您的片段在 FragmentActivity
(或调用另一个 FragmentActivity
通过意图
并添加您的片段就可以了)。
有关更多信息,请参见本主题:添加一个片段的活动在运行时。
You need to create a FragmentManager
to add your fragment in a FragmentActivity
(or call another FragmentActivity
via an Intent
and add your fragment on it).
See this topic for more information: Add a Fragment to an Activity at Runtime.