我想要一個webview進入彈出對話框。我可以得到它與webview彈出,但是當我嘗試使它加載一個Url,它崩潰了我的應用程序...任何幫助?我也嘗試將WebView設置放入OnCreate中。Android - Webview在彈出對話框中?
case R.id.calculatorBtn:
Dialog dialog = new Dialog(DrawingActivity.this);
dialog.setContentView(R.layout.webviewdialog);
dialog.setTitle("Calculator");
dialog.setCancelable(true);
dialog.show();
它工作得很好,直到我在這條線下面添加了這個東西。
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://myurl.com/hi.html");
break;
我也有同樣的問題,但如何加載使用javainterface –