java.lang.IllegalStateException: No activity

前端 未结 5 920
自闭症患者
自闭症患者 2020-12-09 19:53

I\'m building an Android app for which I\'d like my first activity to be composed of 2 tabs, one for the user\'s profile, and one for the friends\' activity. For these tabs,

5条回答
  •  暖寄归人
    2020-12-09 20:37

    Finally found out what this was about: the "no activity" crash was due to the fact that I was using a wrong FragmentManager to nest Fragments.

    For nested fragments, the only valid FragmentManager is the one obtained in the containing Fragment, by calling getChildFragmentManager().

提交回复
热议问题