File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " wry " : patch
3
+ ---
4
+
5
+ Add flag to opt out of automatic back navigation handling on Android via ` WryActivity#handleBackNavigation ` .
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity
14
14
15
15
abstract class WryActivity : AppCompatActivity () {
16
16
private lateinit var mWebView: RustWebView
17
+ open val handleBackNavigation: Boolean = true
17
18
18
19
open fun onWebViewCreate (webView : WebView ) { }
19
20
@@ -102,7 +103,7 @@ abstract class WryActivity : AppCompatActivity() {
102
103
}
103
104
104
105
override fun onKeyDown (keyCode : Int , event : KeyEvent ? ): Boolean {
105
- if (keyCode == KeyEvent .KEYCODE_BACK && mWebView.canGoBack()) {
106
+ if (handleBackNavigation && keyCode == KeyEvent .KEYCODE_BACK && mWebView.canGoBack()) {
106
107
mWebView.goBack()
107
108
return true
108
109
}
You can’t perform that action at this time.
0 commit comments