Fragment activity crashes on screen rotate

前端 未结 5 625
刺人心
刺人心 2021-01-01 18:22

I have a simple fragment activity. In the onCreate() method, I simply add a fragment. The code is posted below. However, each time I rotate the screen, system will call onCr

5条回答
  •  悲哀的现实
    2021-01-01 18:39

    The Fragment class also should not be an inner class, because it is instantiated out of your Activity class scope. Nested class is ok.

提交回复
热议问题