diff --git a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt index e655352fc7d3..81d1cc965ed7 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt @@ -126,6 +126,10 @@ fun ModuleScreen(navigator: DestinationsNavigator) { var zipUri by remember { mutableStateOf(null) } var showConfirmDialog by remember { mutableStateOf(false) } + + val webUILauncher = rememberLauncherForActivityResult( + contract = ActivityResultContracts.StartActivityForResult() + ) { viewModel.fetchModuleList() } Scaffold( topBar = { @@ -225,7 +229,7 @@ fun ModuleScreen(navigator: DestinationsNavigator) { }, onClickModule = { id, name, hasWebUi -> if (hasWebUi) { - context.startActivity( + webUILauncher.launch( Intent(context, WebUIActivity::class.java) .setData(Uri.parse("kernelsu://webui/$id")) .putExtra("id", id) @@ -702,4 +706,4 @@ fun ModuleItemPreview() { hasActionScript = false ) ModuleItem(EmptyDestinationsNavigator, module, true, "", {}, {}, {}, {}) -} \ No newline at end of file +}