Bytecode
Bytecode

Reputation: 6591

Android onRestoreInstanceState(Bundle savedInstanceState)


In my application during normal operation the onRestoreInstanceStatance function is executed and causes a null pointer exception in some listener, without invoking that listener. My app contains a lot of data that I write to a file in onPause and restore in onResume and onRestoreInstanceStatance. How can I make the app stable?

Upvotes: 3

Views: 1044

Answers (1)

Vit Khudenko
Vit Khudenko

Reputation: 28418

Make sure you assign listeners in the end of the onResume, that will ensure no listeners are fired BEFORE the initial state is set. Then in onPause first thing to do is to remove listeners.

Upvotes: 2

Related Questions