KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
the following code works fine in all devices running android 2.x , but not in a Nexus 7 tablet with 4.1.2 The problem is that the shouldOverrideUrlLoading never run. The onPageFinished run ok I'll appreciate any available help. wv = (WebView) root_view.findViewById(R.id.wv); wv.setBackgroundColor(res.getColor(R.color.def_bgr_color)); wv.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); wv.setWebViewClient(new MyWebViewClient() ); WebSettings web_settings = wv.getSettings(); web_settings.setJavaScriptEnabled(true); web_settings.setLoadWithOverviewMode(true); web_settings.setUseWideViewPort(false); web_settings.setPluginsEnabled(true); web_settings.setSupportZoom(true); web_settings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); public class MyWebViewClient extends WebViewClient { public MyWebViewClient() { } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.i(TAG, "RUN shouldOverrideUrlLoading" ); return true; } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); Log.i(TAG, "RUN onPageFinished" ); } } String html_str = ... something html ... wv.loadDataWithBaseURL("file:///android_asset/", html_str, "text/html", "utf-8", null);
Tags (comma-separated)
Save Edits
Cancel