android - Associate same looper with different threads -


in application, want create multiple threads working on single queue. create queue know need call looper.prepare().

i want other threads create should associated looper created first thread, how can achieve this?

use 1 of java thread safe queue class java.util.concurrent package instead of looper achieve goal. it's more common practice.

share queue between threads , post task queue entry 1 thread can entry thread. blockingqueue can - in 1 thread call take() , block thread until thread put() entry queue. that's all.

producer consumer pattern example

blockingqueue or concurrentlinkedqueue

about blockingqueue

enter image description here


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -