I strongly recommend using IntentService, which takes care of the threading
for you.  Unless you are good at multithreading (I will claim that 90% of
developers are not) then it is a good idea to stay away from Thread and use
some higher-level facilities like IntentService, AsyncTask, etc.

On Fri, Apr 9, 2010 at 7:40 AM, Mark Murphy <[email protected]> wrote:

> Jason LeBlanc wrote:
> > Yes, the Connection extends Thread.
>
> Then be sure not to do anything time-consuming in the Connection
> constructor. Put the time-consuming stuff in run(). In this case, that
> includes opening your socket connection, because while it might not be
> time-consuming normally, it will be if it cannot resolve DNS, etc.
>
> > If I start a Thread in an Activity, does that Thread need to complete
> > execution before I can transition to the next Activity?
>
> No.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to