- Fixed an issue with launching Forge on mobile for some users.

This commit is contained in:
Agetian
2017-08-27 17:59:15 +00:00
parent 9005598f90
commit f7c4fe8e91

View File

@@ -85,7 +85,11 @@ public class Main extends AndroidApplication {
protected void onPause()
{
super.onPause();
if (FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_ANDROID_MINIMIZE_ON_SCRLOCK)) {
ForgePreferences prefs = FModel.getPreferences();
boolean minimizeonScreenLock = prefs != null && prefs.getPrefBoolean(ForgePreferences.FPref.UI_ANDROID_MINIMIZE_ON_SCRLOCK);
if (minimizeonScreenLock) {
// If the screen is off then the device has been locked
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
boolean isScreenOn = powerManager.isScreenOn();