In the array, keep track of the calls that will be called, then if you want to be called, cancel postDelayed and call runnables directly to run them, just call the run() method from runnable, Example code:
Pretty easy, and I commented on it so that you can understand it better, but if you do not understand something, just comment on it. You can change it to support multiple calls of the same Runnable, or simply create your own TrackingHandler handler class extension with implemented functions or something.
I wrote the code right now on the fly, so itβs possible that there are a lot of typos, I donβt know.
source share