Lemme guess: You created a Thread but you never started it. On Oct 28, 1:42 pm, Hank <hwang...@gmail.com> wrote: > In my code, I don't have "wait" or "block" in the main thread, but in > the child thread. So supposedly only the child thread should "wait" or > "block". > > On Oct 28, 2:37 pm, DanH <danhi...@ieee.org> wrote: > > > The problem is that you should never "wait" or "block" in the main > > thread. Your background thread needs to somehow notify the main > > thread that the connection is ready, and until then the main thread > > should be "spinning" (in the figurative sense) in its event loop, not > > sitting on a "wait". > > > On Oct 28, 1:08 pm, Hank <hwang...@gmail.com> wrote: > > > > Within my service I created a new thread that will try to establish a > > > internet connection, and I want it to wait for the connection to be > > > established before doing anything. But when I call wait() or use > > > ConditionalVariable.block(), it blocks the whole application and > > > causes ANR. Does anybody know why it does that even though I created a > > > child thread for this task? and do you have any solutions for this > > > problem?
-- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en