disable touch focus while loading
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.
精彩评论