对的onSaveInstanceState的文档()
规定:
The documentation on onSaveInstanceState()
states:
如果该方法被调用时,它总是叫的onStop(前)和可能之前的onPause()。
If the method is called, it is always called before onStop() and possibly before onPause().
不过,我注意到,始终如一,从日志消息的onPause()
总是调用之前的onSaveInstanceState()
。我在这两种方法把日志消息。请帮助我了解在什么情况下的onSaveInstanceState()
之前的onPause称为()
。
But, I notice, consistently, from log messages that onPause()
is ALWAYS CALLED BEFORE onSaveInstanceState()
. I had put log messages in these two methods. Please help me understand in what circumstances does onSaveInstanceState()
is called before onPause()
.
环境:Android的V4.0(API 14)+ Eclipse的v3.7.1 - 靛蓝
Environment: Android v4.0 (API 14) + Eclipse v3.7.1 - Indigo.
您可以阅读关于这里。
在简单地说,你不能永远不知道关于时间的onSaveInstanceState将运行。
In a nutshell you can't never know about time when onSaveInstanceState will be run.