From 27b7d6e22c86891b6ba267c91fff8542c8426657 Mon Sep 17 00:00:00 2001 From: Michael Shafrir <45020849+mshafrir-stripe@users.noreply.github.com> Date: Mon, 8 Jun 2020 14:17:59 -0400 Subject: [PATCH] Update PaymentAuthWebViewActivity back button behavior (#2554) If `PaymentAuthWebViewActivity`'s `WebView` can go back, do that instead of finishing the Activity. --- .../com/stripe/android/view/PaymentAuthWebViewActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stripe/src/main/java/com/stripe/android/view/PaymentAuthWebViewActivity.kt b/stripe/src/main/java/com/stripe/android/view/PaymentAuthWebViewActivity.kt index ec1a7a633bc..e7d2b8d11c1 100644 --- a/stripe/src/main/java/com/stripe/android/view/PaymentAuthWebViewActivity.kt +++ b/stripe/src/main/java/com/stripe/android/view/PaymentAuthWebViewActivity.kt @@ -101,7 +101,11 @@ class PaymentAuthWebViewActivity : AppCompatActivity() { } override fun onBackPressed() { - cancelIntentSource() + if (viewBinding.authWebView.canGoBack()) { + viewBinding.authWebView.goBack() + } else { + cancelIntentSource() + } } private fun cancelIntentSource() {