Retain the Fragment object while rotating

后端 未结 6 1243
滥情空心
滥情空心 2020-12-01 00:18

I have developed an app in Honeycomb and I am using fragments.
This is my app

  • I have an Activity (Say A1) and in that there is a fragment
  • Initi
6条回答
  •  独厮守ぢ
    2020-12-01 00:32

    You can simply set the RetainInstance property inside OnCreate of the fragment class.

    public override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        RetainInstance = true;
    }
    

    Retain the Fragment object while rotating

提交回复
热议问题