Does anyone know of a way to Display URL's in webview like this
But here I am geting Like this here no focus and no click option not working any thing give me some sugessions please..
this code useing display data in webview
webview.getSettings().setJavaScriptEnabled(true);
webview.loadDataWithBaseURL(null, string, "text/html", "utf-8", null);
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. In the above code, we have taken web view to show html content.
This can be achieved using below code. webview. setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { webview. loadUrl("javascript:window.
Alternatives to WebView If you want to send users to a mobile site, build a progressive web app (PWA). If you want to display third-party web content, send an intent to installed web browsers. If you want to avoid leaving your app to open the browser, or if you want to customize the browser's UI, use Custom Tabs.
This interface was deprecated in API level 12. This interface is now obsolete.
Use Linkify
.
Spannable sp = new SpannableString(Html.fromHtml(string));
Linkify.addLinks(sp, Linkify.ALL);
final String html = "<body>" + Html.toHtml(sp) + "</body>";
webView.loadData(html, "text/html", "utf-8");
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