开发者

disable touch focus while loading

开发者 https://www.devze.com 2023-03-30 02:22 出处:网络
I have an android app that uses a glSurfaceView that takes a few sections to load up. I have onTou开发者_开发知识库chEvent overridden, and I\'m trying to disable focus while it loads but setFocusable

I have an android app that uses a glSurfaceView that takes a few sections to load up.

I have onTou开发者_开发知识库chEvent overridden, and I'm trying to disable focus while it loads but setFocusable(false) isn't working.

The problem is if the user taps on the screen before everything loads, the app gets a null and it crashes.


I'd pop up a progress dialog and use an AsyncTask to do the loading of the view. Once the view is loaded you can kill the dialog. Any heavy lifting should not be done on the UI thread anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号