@Override
public int runWithDelay(@NonNull final Runnable runnable, @IntRange(from = 0) long delayInMillis) {
final int taskId = getTaskId(scheduledTasks);
CountDownTimer scheduledTask = new CountDownTimer(delayInMillis, delayInMillis) {
@Override
public void onTick(long l) {
// do nothing (is disabled anyway because "countDownInterval" is set to "millisInFuture")
}
@Override
public void onFinish() {
scheduledTasks.remove(taskId);
runnable.run();
}
}.start();
scheduledTasks.put(taskId, scheduledTask);
return taskId;
}
AsynchronousBackgroundHandler.java 文件源码
java
阅读 42
收藏 0
点赞 0
评论 0
项目:BWS-Android
作者:
评论列表
文章目录