Skip to content

Commit cddbb76

Browse files
committed
Launch startActivity in IO coroutine scope
Wrapped the startActivity call in a coroutine launched on the IO dispatcher to ensure it runs asynchronously. This improves responsiveness and prevents blocking the main thread.
1 parent aca0755 commit cddbb76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

webui/src/main/kotlin/com/dergoogler/mmrl/webui/interfaces/ApplicationInterface.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ class ApplicationInterface(
9696

9797
@JavascriptInterface
9898
fun startActivity(i: IntentData) {
99-
withActivity {
100-
startActivity(i.intent)
99+
scope.launch(Dispatchers.IO) {
100+
withActivity {
101+
startActivity(i.intent)
102+
}
101103
}
102104
}
103105

0 commit comments

Comments
 (0)