Fixed issue with new main activity blanking rather than staying on. Fixes #141

This commit is contained in:
Graham Jones
2024-01-31 21:32:30 +00:00
parent 1a98e1094e
commit 1be6e51406
5 changed files with 12 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:versionCode="133" android:versionCode="133"
android:versionName="4.2.1q"> android:versionName="4.2.1r">
<!-- android:allowBackup="false" --> <!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -21,6 +21,7 @@ import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
@@ -154,6 +155,10 @@ public class MainActivity2 extends AppCompatActivity {
} catch (Exception ex) { } catch (Exception ex) {
Log.e(TAG, "exception starting main activity " + ex.toString()); Log.e(TAG, "exception starting main activity " + ex.toString());
} }
// Force the screen to stay on when the app is running
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
} }

View File

@@ -2,12 +2,15 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> <style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. --> <!-- Customize your theme here.
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorPrimary">#a0a0a0</item>
-->
</style> </style>
</resources> </resources>

View File

@@ -55,13 +55,14 @@
android:key="OSDUrl" android:key="OSDUrl"
android:summary="@string/remote_url_summary" android:summary="@string/remote_url_summary"
android:title="@string/remote_url_title" /> android:title="@string/remote_url_title" />
-->
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="PreventSleep" android:key="PreventSleep"
android:summary="@string/prevent_sleep_summary" android:summary="@string/prevent_sleep_summary"
android:title="@string/prevent_sleep_title" /> android:title="@string/prevent_sleep_title" />
-->
<!--<EditTextPreference <!--<EditTextPreference
android:defaultValue="1000" android:defaultValue="1000"
android:key="UpdatePeriod" android:key="UpdatePeriod"