Could you please supply more code (maybe the entire method/class) so we can see the context in which this is placed. There is a good chance that the previous code is causing this part to crash.
Try replacing: webview = (WebView) findViewById(R.id. Webview); with: webview = (WebView) dialog. FindViewById(R.id.
Webview); Also, usually, the first thing you do when your app crashes is you look in logcat for an exception and try to figure out what is wrong from it. If you can't and end up posting a question on Stack Overflow, that exception is very useful for us, in order to help you. I bet the exception you're getting is an NullPointerException on this line: webview.getSettings().
SetJavaScriptEnabled(true).
The may be in initializing the value of webview. Try with the following code Dialog dialog = new Dialog(DrawingActivity. This); LayoutInflater inflater = (LayoutInflater)getSystemService(Context.
LAYOUT_INFLATER_SERVICE); View vi = inflater. Inflate(R.layout. Webviewdialog, null); dialog.
SetContentView(vi); dialog. SetTitle("Calculator"); dialog. SetCancelable(true); WebView wb = (WebView) vi.
FindViewById(R.id. Webview); wb. LoadUrl("http://developer.android.com/guide/topics/ui/dialogs.html"); System.out.
Println("..loading url.."); dialog.show().
Perfect, thanks! One question... How could I enable javascript in this? I cannot seem to, and if I put webview.getSettings()setJavascriptEnabled(true); the app force closes... – user802609 Jun 22 at 0:43 try wb.getSettings().
SetJavaScriptEnabled(true); I have tried now – Sunil Kumar Sahoo Jun 22 at 4:55.
I am trying to get a webview into a popup dialog. I can get it to pop up with the webview, but when I try to make it load a Url, it crashes my app... Any help? I have also tried putting the webview settings in OnCreate.
IT WORKS FINE UNTIL I ADD THE STUFF BELOW THIS LINE.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.