Should I restore savedinstancestate in onCreate or in onRestoreInstanceState?

牧云@^-^@ 提交于 2019-12-04 23:03:13

"Instead of restoring the state during onCreate() you may choose to implement onRestoreInstanceState(), which the system calls after the onStart() method. The system calls onRestoreInstanceState() only if there is a saved state to restore, so you do not need to check whether the Bundle is NULL"

following link explain pretty clearly about restart activity.

Android Guide

The onRestoreInstanceState( ) method is invoked by Android between the onStart( ) and the onResume( ) lifecycle methods.So, in order to restore the state of your activity, simply implement the onRestoreInstanceState( ) method restore activity state.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!