Have you read the article on Processes and Threads yet?
Always remember the two most important rules when working with threads:
Speed up your apps response times. Move all processing and I/O operations off the main thread. Do the work in a child thread. Our tutorial will show you how.
All Android components (like activities and services) start on the main thread. This is the thread that the user interacts with.
You need to keep this thread clear so that the app does not hang. It’s a good idea to put all time-consuming processes on a separate thread.
Put file operations, network lookups, database interaction, etc. on a background thread.