读书人

Activity(1)

发布时间: 2012-07-01 13:15:00 作者: rapoo

Activity(一)
How to start an Intent?





Saving activity state

There's no guarantee that onSaveInstanceState() will be called before your activity is destroyed, If the system calls onSaveInstanceState(), it does so before onStop() and possibly before onPause().

Because the default implementation of onSaveInstanceState() helps save the state of the UI, if you override the method in order to save additional state information, you should always call the superclass implementation of onSaveInstanceState() before doing any work. Likewise, you should also call the supercall implementation of onRestoreInstanceState() if you override it, so the default implementation can restore view states.

A good way to test your application's ability to restore its state is to simply rotate the device so that the screen orientation changes.

读书人网 >移动开发

热点推荐