Hope this is not too late for an answer. You can access the current thread's message queue by calling Looper.myQueue (). However, the MessageQueue class does not have methods to find out its size or what element in each message. To do this, you can try the Handler class. The handler controls the looper that has the queue, and this handler has methods such as hasMessages, getMessage, removeMessages, etc. I think this is your best chance.
source share