android fragment onRestoreInstanceState
Fragments do not have an onRestoreInstanceState
method.
You can achieve the same result in onActivityCreated
, which receives a bundle with the saved instance state (or null).
Check the source code here.
I know, that you have accepted answer, but you should read the official documentation about fragments, and it says (paragraph "Handling the Fragment Lifecycle"):
You can retain the state of a fragment using a Bundle, in case the activity's process is killed and you need to restore the fragment state when the activity is recreated. You can save the state during the fragment's onSaveInstanceState() callback and restore it during either onCreate(), onCreateView(), or onActivityCreated()
So, you can use that suits you best: onCreate()
, onCreateView()
, or onActivityCreated()