Example code showing how to properly work with threads in Android.