Android: after closing the application still works

I use webviewand I add a query string with a url. Let's say the URL file:///android_asset/www/index.htmland I added a query string ?urlid=MindTree_Projects&city=bangalore&firstTimeRule=%7B%22EEI....something. So the whole url looks like file:///android_asset/www/index.html?urlid=MindTree_Projects&city=bangalore&firstTimeRule=%7B%22EEI....something. Now suppose that I open the application and then close it, it still works, but in the foreground it closed.

Only I see what it works for chrome://inspect. This is one way to debug web applications.

Can someone tell me why this is happening, this is worth it to me.

-2
source share
1 answer

You may need to call the methods onPause()and onResume() WebView Class .

@Override
protected void onPause()
{
    super.onPause();
    mWebView.onPause(); // pauses the WebView (JavaScript, flash etc.)
}

@Override
protected void onResume()
{
    super.onResume();
    mWebView.onResume(); // resumes the WebView (JavaScript, flash etc.)

}

@Override
protected void onDestroy()
{
    super.onDestroy();
    relativeLayoutPlaceholder.removeView(mWebView); // removes the WebView from its Placeholder
    mWebView.destroy(); // destroys the WebView
    mWebView = null;
}
+1

Source: https://habr.com/ru/post/1648354/


All Articles