1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Made sure that player activity is always single instance.

This commit is contained in:
Koen J 2024-12-06 15:03:06 +01:00
parent 097ecf5584
commit b7e304b987
2 changed files with 13 additions and 0 deletions

View file

@ -26,6 +26,7 @@
<activity
android:name=".MainActivity"
android:theme="@style/Theme.Main"
android:launchMode="singleInstance"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -41,6 +42,7 @@
<activity
android:name=".PlayerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleInstance"
android:theme="@style/Theme.Player" />
<receiver

View file

@ -0,0 +1,11 @@
package com.futo.fcast.receiver
import android.os.Looper
import android.util.Log
fun ensureNotMainThread() {
if (Looper.myLooper() == Looper.getMainLooper()) {
Log.e("Utility", "Throwing exception because a function that should not be called on main thread, is called on main thread")
throw IllegalStateException("Cannot run on main thread")
}
}