I'm new to android and I read a book for beginners which said that onSaveInstanceState(Bundle)
is ensured to be called before the system reclaims your Activity
.
I tried it on some test codes and found it incorrect. I found that onSaveInstanceState(Bundle)
was called every time after onPause()
was called. And it has nothing to do with system reclaimation.
I'm not very sure about it, so that's the question: when is onSaveInstanceState(Bundle)
called actually?
I don't agree with a previous answer.
According to the Documentation:
If called, this method will occur before onStop(). There are no guarantees about whether it will occur before or after onPause().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With