Fragment ViewState restored in onStart?

前端 未结 3 2021
长发绾君心
长发绾君心 2021-02-06 05:08

When orientation changes, fragment viewState restored only in onStart. After onAttach, onCreateView, onViewCreated

3条回答
  •  半阙折子戏
    2021-02-06 05:43

    You can always handle orientation changes yourself with onConfigurationChanged(). See a nice example here http://alexfu.tumblr.com/post/13926762386/android-dev-handling-fragment-recreation-manually

提交回复
热议问题