I've used webview to show a website in my application. This is my code:
final ProgressDialog progressBar;
WebView wb=(WebView)findViewById(R.id.wb);
WebSettings settings = wb.getSettings();
settings.setDefaultTextEncodingName("utf-8");
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setSaveFormData(false);
settings.setSupportZoom(true);
settings.setJavaScriptEnabled(true);
settings.setSaveFormData(false);
settings.setSavePassword(false);
progressBar = ProgressDialog.show(this, "","در حال دریافت اطلاعات");
wb.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
public void onPageFinished(WebView view, String url) {
if (progressBar.isShowing()) {
progressBar.dismiss();
}
}
});
Bundle bl=getIntent().getExtras();
wb.loadUrl("http://mysite");
It loads the website correctly, but it has lot of menus and some part doesn't work. These parts works fine in the mobile browser but doesn't work in the webview of mine.
I think part of the code are javascript or jquery and they are not working properly in webview.
How can I fix this?