1

I use Activity with WebView for payment integration in my application. Payment process uses 3-D Secure (3DS) with a confirmation via SMS. User need to close my application (WebView activity in background and SMS in foreground), read SMS and after that returns to my application and enter the code from SMS. In some cases when a device has low RAM memory Android may destroy activity with WebView through this process. So a user cannot enter the code from SMS because WebView reloaded after destroy.

What is the best practice for this case? How can I keep alive activity with WebView? (I know that there is no 100% solution but I want to keep it alive as long as it possible)

ViT-Vetal-
  • 2,431
  • 3
  • 19
  • 35

1 Answers1

0

A viable solution you could use is to listen for SMS messages and get the code from it as soon as it arrives. You'd have to ask for SMS reading permission. If that doesn't conflict with your app's goals, I suggest you take a look on some of these:

Android – Listen For Incoming SMS Messages

How can I read SMS messages from the device programmatically in Android?

I apologize for not being able to test those right now, but I hope this helps.

Ortiz
  • 294
  • 1
  • 4
  • 14