Blog stats
- 1,153,305 hits

-
Recent Posts
Top Posts
Tags
- android
- android game
- androidgames
- app
- conwaygameoflife
- dashboard
- demo
- double-star
- drag-drop
- emulator
- example
- game
- game design
- gamedev
- gomoku
- google play
- gwt
- hop
- hop-skip-thump
- hopskipthump
- how-to
- in-app billing
- in-app purchase
- indiedev
- indiegame
- IndieGameDev
- Indie Games
- ios
- ios game
- iosgames
- iphone
- java
- lifeforms
- MadeWithUnity
- mvp
- mvp example
- space-war
- splash
- sst
- steam
- steam game
- strategy-game
- touch
- trek
- Tridroid
- tutorial
- ui
- ui thread
- video
- wingleader
Archives
Recent Comments
Tag Archives: ui thread
One Way to Cancel an AsyncTask
In AsyncTask, I have had trouble stopping the task. I found that onCancelled gets called immediately, but the real background task can take a bit longer to finish, particularly if it has break out of a loop that has a long-running computation. To address this problem, I changed the way I used publishProgress in the background task. I added an extra argument to indicate the kind of progress information that was being reported, and used one kind of progress inside the loop and another after the loop completed. Continue reading
Using Android AsyncTask For Background Tasks
My last note (“Long Computations in the Main Android Thread”) explained one way to take an expensive operation and move it to a background task. Since writing that, I have learned about the AsyncTask class. It is much easier way to do the same thing.
If you are looking for a working example of AsyncTask, I have built one and posted the source code at the end of this note.
Continue reading
Long Computations in the Main Android Thread
In an Android application, you should try very hard to keep your application responsive to user actions (clicks, touches, etc.). That means not doing time-consuming operations like network downloads or long computations in the main thread in which an activity runs. Continue reading

