android - Issue with AsyncTask -
in android app, there surfaceview
. whenever user touches short( 1 sec) animation rendered on surfaceview
asynctask
. face force close problem in 2 scenarios.
- when used presses key while animation running.
- in arcade mode game duration of 60 seconds. @ end of game, new activity started. if @ end of game , animation still running while new activity started, force close error message.
how can check if asynctask
complete i.e. animation over, before key press takes effect or new activity started ? using asynctask.getstatus()
in while loop freezing app. or there alternative way this?
one of way wait finish asynctask.execute().get() ;
with main thread wait finish
Comments
Post a Comment