开发者

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 onRestoreIn开发者_如何学编程stanceStatance. How can I make the app stable?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜