load textures into a thread blocks the mainUI in android

核能气质少年 提交于 2019-12-11 06:39:13

问题


I try to load bitmaps and display them into textures (openglES2.0). I make a runnable thread, and once loaded the bitmap are sent to textures. Even my thread is runnable, the main UI Thread freezes for a while during the loading of pictures. I really don't understand this and am pretty lost about it… any clues ?


回答1:


Sounds like you're calling myThread.run() instead of myThread.start()

run() executes in the calling thread, but start() makes a new thread and then calls run inside of that.

If that's not the case, I can't really help you without your relevant code.



来源:https://stackoverflow.com/questions/16625632/load-textures-into-a-thread-blocks-the-mainui-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!