AliSherKashif / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Android warning that webview method is called on EDT thread #180

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create an app with GUI Builder
2.Add a WebView to the main form
3.Deploy the app to an Android deice

What is the expected output? What do you see instead?
As soon as the main form is displayed, the following exception is printed 
several times captured from the device log:

W/webview ( 1054): java.lang.Throwable: Warning: A WebView method was called on 
thread 'EDT'. All WebView methods must be called on the UI thread. Future 
versions of WebView may not support use on other threads.
W/webview ( 1054):  at android.webkit.WebView.checkThread(WebView.java:9355)
W/webview ( 1054):  at android.webkit.WebView.getSettings(WebView.java:4053)
W/webview ( 1054):  at 
com.codename1.impl.android.AndroidImplementation$AndroidBrowserComponent.<init>(
AndroidImplementation.java:2173)
W/webview ( 1054):  at 
com.codename1.impl.android.AndroidImplementation.createBrowserComponent(AndroidI
mplementation.java:2039)
W/webview ( 1054):  at 
com.codename1.ui.BrowserComponent.<init>(BrowserComponent.java:54)
W/webview ( 1054):  at 
com.codename1.components.WebBrowser.<init>(WebBrowser.java:63)
W/webview ( 1054):  at java.lang.Class.newInstanceImpl(Native Method)
W/webview ( 1054):  at java.lang.Class.newInstance(Class.java:1319)
W/webview ( 1054):  at 
com.codename1.ui.util.UIBuilder.createComponent(UIBuilder.java:845)
W/webview ( 1054):  at 
com.codename1.ui.util.UIBuilder.createComponent(UIBuilder.java:1196)
W/webview ( 1054):  at 
com.codename1.ui.util.UIBuilder.createContainer(UIBuilder.java:357)
W/webview ( 1054):  at 
com.codename1.ui.util.UIBuilder.createContainer(UIBuilder.java:346)
W/webview ( 1054):  at 
com.codename1.ui.util.UIBuilder.showForm(UIBuilder.java:2153)
W/webview ( 1054):  at 
generated.StateMachineBase.startApp(StateMachineBase.java:51)
W/webview ( 1054):  at 
generated.StateMachineBase.<init>(StateMachineBase.java:23)
W/webview ( 1054):  at 
generated.StateMachineBase.<init>(StateMachineBase.java:92)
W/webview ( 1054):  at userclasses.StateMachine.<init>(StateMachine.java:21)
W/webview ( 1054):  at ca.coolman.ca.TestWebView.start(TestWebView.java:15)
W/webview ( 1054):  at 
ca.coolman.ca.TestWebViewStub.run(TestWebViewStub.java:37)
W/webview ( 1054):  at 
com.codename1.ui.Display.processSerialCalls(Display.java:962)
W/webview ( 1054):  at com.codename1.ui.Display.mainEDTLoop(Display.java:813)
W/webview ( 1054):  at 
com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:119)
W/webview ( 1054):  at java.lang.Thread.run(Thread.java:856)

What version of the product are you using? On what operating system?
Eclipse plugin build 201204122346 on Ubuntu 11.10, Android ICS 4.0.2 on Samsung 
Galaxy Nexus

Original issue reported on code.google.com by 1815...@coolman.ca on 28 Apr 2012 at 5:49

GoogleCodeExporter commented 9 years ago
Fixed by Chen

Original comment by shai.almog on 2 May 2012 at 3:06