Hi,
I'm displaying a webpage in a WebView and on the webpage, there is a
HTML "select" element.
When you click on drop down list, a dialog with an list of option is
supposed to popup.
But I don't know why my WebView crash.
// sample of code ------------------
private void initialize() {
WebView webView = new WebView(this);
WebSettings webSettings = webView.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(true);
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(false);
webView.loadUrl("file:///android_asset/test.html");
setContentView(webView);
}
// test.html -------------------------
<html>
<body>
<select id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
</body>
</html>
// error message -----------------------------
05-26 12:00:13.380: WARN/dalvikvm(2717): threadid=3: thread exiting
with uncaught exception (group=0x4001b390)
05-26 12:00:13.386: ERROR/AndroidRuntime(2717): Uncaught handler:
thread main exiting due to uncaught exception
05-26 12:00:13.446: ERROR/AndroidRuntime(2717):
android.view.WindowManager$BadTokenException: Unable to add window --
token null is not for an application
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.view.ViewRoot.setView(ViewRoot.java:476)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.app.Dialog.show(Dialog.java:239)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.webkit.WebView$InvokeListBox.run(WebView.java:9837)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.os.Handler.handleCallback(Handler.java:587)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.os.Handler.dispatchMessage(Handler.java:92)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.os.Looper.loop(Looper.java:123)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
android.app.ActivityThread.main(ActivityThread.java:4595)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
java.lang.reflect.Method.invokeNative(Native Method)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
java.lang.reflect.Method.invoke(Method.java:521)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-26 12:00:13.446: ERROR/AndroidRuntime(2717): at
dalvik.system.NativeStart.main(Native Method)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en