问题描述
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 ?
For e.g.
Instead of using "inflater.inflate(R.layout.tabactivity, null)", can we launch activity which uses "tabactivity" as layout ?
推荐答案
Unfortunately this is not possible. You must create a Fragment Activity that will be used to refer to any fragment you create.
This is a good place to start:
其他推荐答案
It's not possible you cannot add Activity inside a fragment. Fragment is part of UI component of Activity.
Refer below link