In Android platform, a View object has an instance method postDelayed, which according to the documentation:
Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses. The runnable will be run on the user interface thread.
My questions:
Thanks.
Why this method has to be an instance method of View?
It references an mAttachInfo data member, in its current implementation, and in turn to that data member's mHandler, which is a Handler that actually does the postDelayed() work (if mAttachInfo is not null). You are welcome to read all of this in the source code.
Would it be different if I call postDelayed in one view instead of another?
In theory, two View instances could work with separate Handler instances. However, from the standpoint of the documented behavior, there should be no difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With