I have an application where I need to load a small web page inside a webview. Web browsing must be loaded inside the dialog box. I tried to implement it; but every time an empty dialog loads and doesn't seem to contain content inside it. The code I used is below
Uri uri = Uri.parse(item.getLink()); Dialog dialog = new Dialog(this); LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.webviewdialog, null); dialog.setContentView(v); dialog.setCancelable(true); WebView wb = (WebView) v.findViewById(R.id.webView1); wb.loadUrl(uri.toString()); dialog.show();
I also tried pasting the urls directly into loadUrl, but I am getting the same problem.
Any help would be appreciated.
android android-webview android-dialog
Avinash
source share