Have question: in my app I have one webView. When I minimize
application and re-open it - in webview I get white space.
I want when I can minimize application and re-open it without
reloading content... code here:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
url = getPrefProperty(this, CURRENT_URL);
if(TextUtils.isEmpty(url)){
//show dialog here
//getting here url and calling
mWebView.loadUrl(url);
}
mWebView = (WebView) findViewById(R.id.webview);
if (savedInstanceState != null){
((WebView)findViewById(R.id.webview)).restoreState(savedInstanceState);
} else {
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setSupportZoom(false);
mWebView.getSettings().setPluginState(WebSettings.PluginState.ON);
mWebView.setWebViewClient(new ManWebViewClient());
//if(!TextUtils.isEmpty(url)) mWebView.loadUrl(url);
}
}
protected void onSaveInstanceState(Bundle outState) {
mWebView.saveState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle state) {
mWebView.restoreState(state);
super.onRestoreInstanceState(state);
//Toast.makeText(getBaseContext(), browser.getUrl(),
Toast.LENGTH_LONG).show();
}
private class ManWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String
url) {
view.loadUrl(url);
return true;
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en