You should not use the following in your case but there is a simple
way to wait for a thread to complete, it's the Thread.join() function.
This should be called only in a background thread which need to
synchronize with another background thread for some reason.
You should (i'd say must) never call blocking functions in the main
thread.

On Nov 6, 8:53 am, hackbod <[EMAIL PROTECTED]> wrote:
> http://code.google.com/android/intro/appmodel.html
>
> The last section is on threads, though it's strongly recommended you
> read the whole thing.
>
> On Nov 5, 9:58 pm, joshbeck <[EMAIL PROTECTED]> wrote:
>
> > I'm fairly new at this and just to the point where threading makes
> > sense.
> > So, my my main process is also considered a thread?
>
> > True --- False
>
> > I write a simple HelloWorld.java program.
> > This program has 1 thread, the main flow of execution.
>
> > ?
>
> > Thanks,
> > Josh
>
> > On Nov 5, 7:26 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > If the thread takes a while to complete, your main application thread
> > > probably shouldn't wait for it to complete...  otherwise, what's the
> > > point of putting that work in the thread, if you're just going to
> > > block on it at some point.
>
> > > Instead, consider using a Handler to post a message back to the main
> > > thread when the background thread has finished its work.
>
> > > On Nov 5, 3:54 pm, joshbeck <[EMAIL PROTECTED]> wrote:
>
> > > > I have a function that utilizes a thread.
>
> > > > A variable the is needed for the program is populated after the thread
> > > > call is made.
>
> > > > The thread takes a while to complete.
>
> > > > How can I make the program wait for a thread to complete before moving
> > > > on?
>
> > > > Thanks,
> > > > Josh Beck
--~--~---------~--~----~------------~-------~--~----~
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