I have a game app, and i have many screens. The first screen will be the SCREEN.LOADING screen.
When the app starting, I want to show a picture "loading please wait" while the images, menus, etc loaded succesfull.
I tried asynctask to do this, but its not work in GLThread. What is the way to do this in opengl-es?
03-06 12:46:35.282: ERROR/AndroidRuntime(32736): Caused by: java.lang.RuntimeException: Can't create handler i开发者_如何转开发nside thread that has not called Looper.prepare()
Thanks, Leslie
Have you made sure to create your AsyncTask
in the UI thread?
While queueEvent
provides an easy way for the UI thread to communicate with the rendering thread, there isn't an obvious solution for the other way given to you by the framework.
As per this advice, passing a Handler
(created in the UI thread) to the GL thread would allow the GL thread to send messages to the Handler
. These messages would then be handled on the UI thread.
精彩评论