I am using an Executor [fixed thread pool] with my own ThreadFactory that adds a Looper:
Handler HANDLER = new Handler();
Executor THREADS = Executors.newFixe
If you check the source in android/os/MessageQueue.java, you can see something like the following
if (mQuiting) {
RuntimeException e = new RuntimeException(
msg.target + " sending message to a Handler on a dead thread");
Log.w("MessageQueue", e.getMessage(), e);
return false;
} else if (msg.target == null) {
mQuiting = true;
}
}
So the message queue is basically unusable after Looper.quit() has been called the first time, as it enqueues a Message with a null target, which is the magical identifier for the message queue to stop enqueuing and appear "dead".