The documentation on onSaveInstanceState() states:
onSaveInstanceState()
If the method is called, it is always called before onStop() and possibly before onPa
onSaveInstanceState() is nice, but only guaranted callback is onPause(), called when your activity loses focus. So, save your state there