Make a wizard like application in Android

后端 未结 5 1988
无人及你
无人及你 2020-12-03 01:00

Which you think is the best way of doing a wizard like application (user can navigate between screens with a next and back button, and each screen has to save some state dat

5条回答
  •  鱼传尺愫
    2020-12-03 01:49

    9 years ago this was obviously a very different kettle of fish - but I think the best way to do this now is with Fragments.

    Have a Fragment for each 'page' in the wizard, letting it handle its own lifecycle and state.

    Change page from within each Fragment with Fragment.getFragmentManager() - this returns the FragmentManager from the parent Activity, allowing the Fragment to replace itself.

提交回复
热议问题