How can I count the number of messages in a queue in a handler?

I use Handler and I would like to count the number of messages waiting. However, I do not see a method that allows me to get this information.

Is it possible?

It seems like hasMessages(int what) , why not expose something like getMessageCount(int what) ?

+4
source share
1 answer

Instead of using a handler, the best solution is to implement a queue.

-1
source

All Articles