I have an Activity A which calls Activity B. In Activity B, when i click on a button, finish() is called, which in turn calls onDestroy() of Activity B and returns to activi
Please notice that onRestoreInstanceState()
is called when activity is recreated but only if:
it was killed by the OS. "Such situation happen when:
onRestoreInstanceState()
will be called."So if you are in your activity and you hit Back button on the device, your activity is finish()
ed and next time you start your app it is started again (it sounds like re-created, isn't it?) but this time without saved state because you intentionally exited it when you hit Back button.