Android onRestoreInstanceState (Bundle savedInstanceState)


 In my application, during normal operation, the onRestoreInstanceStatance function executes and throws a null pointer exception in any listener without calling this listener. My application contains a lot of data, which I write to a file in onPause and restore in onResume and onRestoreInstanceStatance. How can I make the application stable?

+3
source share
1 answer

Be sure to assign listeners at the end onResume, which ensures that the listeners are not fired before the initial state is established. Then onPauseyou first need to remove the listeners.

+2
source

Source: https://habr.com/ru/post/1787388/


All Articles