Android difference between handler.postAtTime and handler.postDelayed

Please tell me the difference between handler.postAtTime and handler.postDelayed in android.And also, please tell me when to use handler.postAtTime and when to use handler.postDelayed.

+6
source share
1 answer

From the documentation:

For postAtTime :

public final boolean postAtTime (Runnable r, long uptimeMillis)
...
uptimeMillis absolute time at which the callback should be executed using the uptimeMillis () time base. ...

And for postDelayed :

public final boolean postDelayed (Runnable r, long delayMillis)
...
delayMillis Delay (in milliseconds) until Runnable is executed. ...


If this is not clear yet, postDelayed() run something after X milliseconds from the current time. So far, postAtTime() launching something at the specified time XX:YY:ZZ.mmm .

+13
source

Source: https://habr.com/ru/post/898259/


All Articles