开发者

android Difference between handler.postAtTime and handler.postDelayed

开发者 https://www.devze.com 2023-04-09 09:40 出处:网络
Please tell me the difference between handler.postAtTime and handler.postDelayed in android.Andalso please guide me when to use handler.postAtTime and when to use 开发者_JS百科handler.postDelayed.From

Please tell me the difference between handler.postAtTime and handler.postDelayed in android.And also please guide me when to use handler.postAtTime and when to use 开发者_JS百科handler.postDelayed.


From documentation:

For postAtTime:

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

And for postDelayed:

public final boolean postDelayed (Runnable r, long delayMillis)
...
delayMillis The delay (in milliseconds) until the Runnable will be executed. ...


If this is still not clear, postDelayed() run something after X millisecond from current time. While postAtTime() runs something at specified time XX:YY:ZZ.mmm.

0

精彩评论

暂无评论...
验证码 换一张
取 消