According to Android documentation :
In addition, the onSaveInstanceState(Bundle) method is onSaveInstanceState(Bundle) before placing the activity in such a background state, allowing you to save any dynamic state of the instance in your activity in this Bundle, so that you can later get it in onCreate(Bundle) if the activity needs to be recreated. For more information about how the life cycle of a process is tied to the activities that it hosts, see the section "Life Cycle Process". Note that it is important to store persistent data in onPause() instead of onSaveInstanceState(Bundle) , because the latter is not part of the lifecycle callbacks, so it will not be called in every situation, as described in its documentation.
Yes onPause() is called before onSaveInstanceState(Bundle) . But onPause() guaranteed to be called part of its life cycle activities .
Usually, when your activity is recreated, for example, when changing the orientation of the device, then onSaveInstanceState(Bundle) is called if you did not specify the android:configChanges in your manifest.xml file.
source share