How to prevent reload on webview when your back to the app? When tapping home key and then back to the app, the webview was reloaded. I dont want this behaviour, I want users to view the previous page (w/o reload) that they accessed.
private WebView webView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl( WEBSITE_URL );
}
thanks
Test this by adding android:launchMode="singleInstance"
to your <activity>
element in your androidmanifest.xml
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With