[android-developers] does a handler prevents memory leaks???

2011-01-10 Thread Shawn Brown
Hi, Android docs(1) suggest using threads and a handler to send messages (to avoid ANR). Fine. I've always done that but then porting some code to Android noticed that it's not necessary. Passing the Activity (i.e. Context) works fine. public class WorkerThread extends Thread { private

Re: [android-developers] does a handler prevents memory leaks???

2011-01-10 Thread Dianne Hackborn
Toasts must be shown from a thread that is running a handler, and by doing so you are causing that thread to be a UI a thread for the duration of a toast with the corresponding constraints (it will not execute its work if you block it with your own stuff). You are only living on luck if you touch