Crash upon screen being unlocked

♀尐吖头ヾ 提交于 2019-12-04 15:52:14

As the doc says:

When a configuration change occurs at runtime, the activity is shut down 
and restarted by default, but declaring a configuration with this attribute
will prevent the activity from being restarted. 

So i change the AndroidManifest.xml to include all configurations.

android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"

It works for me.

You have to check your application states by making sure that you are handling all possible states. This problem happen when your application state goes into unhandled state like onResume or onStart.

This article will help you understand each state and when it is invoked

http://www.android-app-market.com/android-activity-lifecycle.html

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