当设备进入睡眠模式时,如何阻止我的应用程序关闭,我发现任何时候我的设备进入睡眠模式我的应用程序关闭但我希望它在设备进入睡眠模式时仍然打开
答案 0 :(得分:0)
http://developer.android.com/training/basics/activity-lifecycle/index.html
查看OnPause()函数!
@Override
public void onPause() {
super.onPause(); // Always call the superclass method first
// Release the Camera because we don't need it when paused
// and other activities might need to use it.
if (mCamera != null) {
mCamera.release()
mCamera = null;
}
}
祝你好运开心!