Skip to navigation
WebView Example android
21.04.22
private class MyBrowser extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } public void create_dialog(Context self) { dialog = new Dialog(self); dialog.setTitle("About"); dialog.setContentView(R.layout.about); TextView text = (TextView) dialog.findViewById(R.id.about_text); String t = get_about(); WebView browser = (WebView) dialog.findViewById(R.id.about_html); browser.setWebViewClient(new MyBrowser()); browser.loadData(t, "text/html","UTF-8"); //text.setText(t); text.setText(HtmlCompat.fromHtml(t, 0)); Button close_btn = (Button) dialog.findViewById(R.id.btn_close); close_btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { dialog.dismiss(); } }); dialog.show(); }
https://www.javatpoint.com/android-webview-example
Reply
Anonymous
to embed the browser into the webview browser.setWebViewClient(new MyBrowser()) private class MyBrowser extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }
21.04.22
Reply
Anonymous
Information Epoch 1732505152
You can always add complexity.
Home
Notebook
Contact us