fix #31, never allow phone sleep while on the main screen
This commit is contained in:
parent
c8266491be
commit
0dab91be56
|
@ -549,6 +549,7 @@ public class MainActivity extends SimpleActivity
|
|||
checkButtons();
|
||||
}
|
||||
}
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
private void resumeCameraItems() {
|
||||
|
@ -577,6 +578,7 @@ public class MainActivity extends SimpleActivity
|
|||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
if (!hasCameraAndStoragePermission() || mIsAskingPermissions)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue