What is the difference between Fragment and FragmentActivity?

前端 未结 4 424
太阳男子
太阳男子 2020-11-27 09:03

My question is apart from the obvious inheritance differences, what are the main differences between Fragment and FragmentActivity? To what scenarios are each class best sui

4条回答
  •  借酒劲吻你
    2020-11-27 09:53

    FragmentActivity is our classic Activity with fragment support, nothing more. Therefore FragmentActivity is needed, when a Fragment will be attached to Activity.

    Well Fragment is good component that copy the basic behaviors of Activity, still not a stand-alone application component like Activity and needs to be attached to Activity in order to work.

    Look here for more details

提交回复
热议问题