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)