问题
Is there a way to find out the message queue size and what item is in each message? Is it Looper.getMainLoop or something?
回答1:
Hope it's not too late for an answer. You can access the current thread's message queue calling Looper.myQueue() on it. However, the MessageQueue class has no methods to find out its size or what item is in each message. For that purpose, you could try the Handler class. A handler manages a looper, which has a queue, and that handler has methods like hasMessages, obtainMessage, removeMessages, and so on. I think that is your best shot.
来源:https://stackoverflow.com/questions/9478111/where-can-i-find-pending-message-on-the-message-queue-in-android