Android:如何忽略或禁用savedInstanceState?
我想忽略或禁用savedInstanceState,以便当我转到下一个活动时不会保存当前活动的状态。
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
I want to ignore or disable savedInstanceState so that the state of current activity won't save when I go to the next activity.
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只是这样:
Just this:
在您的活动 xml 文件中写入以下行:
Write this line in your activity xml file:
或者这个:
Or this:
只需重写
onRestoreInstanceState
而不调用超级版本Just override
onRestoreInstanceState
without calling the super version