Replacing fragments and orientation change

前端 未结 3 1572
余生分开走
余生分开走 2020-12-25 14:20

I\'m developing an Android application targeting 2.x and 3.0 devices and thus I\'m using the compatibilty API. I\'m testing on Android 2.0.

I\'m trying to replace a

3条回答
  •  感情败类
    2020-12-25 14:45

    For reference reasons: We were able to solve a very similar problem by adding an android:id to our fragment created in XML.

    This very important precondition for supporting crash-free rotation is only mentioned as a side-note in the documentation:

    Note: Each fragment requires a unique identifier that the system can use to restore the fragment if the activity is restarted (and which you can use to capture the fragment to perform transactions, such as remove it).

提交回复
热议问题