v0.1.7 — Settings back button returns to main, doesn't exit app

The screen enum lives entirely inside Compose, so the system back press
went straight to Activity.finish(). Added a BackHandler in the SETTINGS
branch that intercepts and routes back to MAIN.

versionCode 7 → 8, versionName 0.1.6 → 0.1.7.
This commit is contained in:
2026-04-28 22:16:09 -04:00
parent d8670f4c32
commit dc2eb9881e
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ android {
applicationId = "org.soulstone.overwatch"
minSdk = 26
targetSdk = 35
versionCode = 7
versionName = "0.1.6"
versionCode = 8
versionName = "0.1.7"
}
buildTypes {
@@ -9,6 +9,7 @@ import android.os.Build
import android.os.Bundle
import android.provider.Settings as AndroidSettings
import androidx.activity.ComponentActivity
import androidx.activity.compose.BackHandler
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.runtime.collectAsState
@@ -115,6 +116,10 @@ class MainActivity : ComponentActivity() {
)
}
Screen.SETTINGS -> {
// Route system back into MAIN instead of letting the
// activity finish — the screen enum is internal to
// Compose and the OS doesn't know about it.
BackHandler { screen = Screen.MAIN }
val running by DetectionService.running.collectAsState()
SettingsScreen(
settings = settings,