Currently (Android API 17), the only mention of super
in the Android Reference on Fragment is casually via some code examples (unlike the Android Reference on Activity, which carefully notes where super
is required).
SO suggests searching the web as needed, or waiting for a crash, to identify where a call to super
is required. I'm asking SO users to share their knowledge on which of the Fragment lifecycle methods require a call to super
.
Fragment lifecycle methods - require call to super
onAttach()
onCreate()
- presumably yes, asActivity
version requires itonCreateView()
- seems ok with or withoutonActivityCreated()
onViewStateRestored()
onStart()
- presumably yes, asActivity
version requires itonResume()
- presumably yes, asActivity
version requires itonPause()
- presumably yes, asActivity
version requires itonStop()
- presumably yes, asActivity
version requires itonDestroyView()
onDestroy()
- presumably yes, asActivity
version requires itonDetach()
onSaveInstanceState()
- presumably yes, asActivity
version requires it