Friday, September 9, 2011

Re: [android-developers] Re: java Thread class vs Android HanderThread: which is better?

yup. got it. Thanks

On Fri, Sep 9, 2011 at 11:12 AM, Doug <beafdefx@gmail.com> wrote:
On Sep 7, 8:52 pm, Pratik Prajapati <pratik.prajap...@gmail.com>
wrote:
> Android documentation says that "consider
> usingAsyncTask<http://developer.android.com/reference/android/os/AsyncTask.html>
>  or HandlerThread<http://developer.android.com/reference/android/os/HandlerThread.html>,
> instead of the traditional
> Thread<http://developer.android.com/reference/java/lang/Thread.html>
>  class"
>
> Any specific reason for this? Is it like " HanderThread" is just
> simpler implantation or also provides better performance?

HandlerThread is (surprise) a thread with a Handler attached to it to
process the messages in the thread's Looper.  If you don't need or use
a Handler for processing messages, then you don't need HandlerThread.

Doug

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Kind Regards,
Pratik Prajapati



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment