Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find pending message on the message queue in android?

Is there a way to find out the message queue size and what item is in each message? Is it Looper.getMainLoop or something?

like image 439
user1118019 Avatar asked Nov 13 '22 09:11

user1118019


1 Answers

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.

like image 93
Alex Machado Avatar answered Nov 16 '22 04:11

Alex Machado