Skip to content

Commit 5f479c0

Browse files
authored
fix(core): requestPermission crash regression on Android, closes #15323 (#15336)
* fix(core): requestPermission crash regression on Android, closes #15323 regression from #14484 PluginManager::onActivityCreate is never called, this fixes it * tag * super
1 parent 1b26769 commit 5f479c0

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:bug
3+
---
4+
5+
Fix crash when using the requestPermission API on Android.

crates/tauri/mobile/android-codegen/TauriActivity.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package {{package}}
88

99
import android.content.Intent
1010
import android.content.res.Configuration
11+
import android.os.Bundle
1112
import app.tauri.plugin.PluginManager
1213
import androidx.lifecycle.DefaultLifecycleObserver
1314
import androidx.lifecycle.LifecycleOwner
@@ -33,6 +34,11 @@ object TauriLifecycleObserver : DefaultLifecycleObserver {
3334
abstract class TauriActivity : WryActivity() {
3435
override val handleBackNavigation: Boolean = false
3536

37+
override fun onCreate(savedInstanceState: Bundle?) {
38+
super.onCreate(savedInstanceState)
39+
PluginManager.onActivityCreate(this)
40+
}
41+
3642
fun getPluginManager(): PluginManager {
3743
return PluginManager
3844
}

0 commit comments

Comments
 (0)