How to execute one task every hour?

后端 未结 4 1757
天命终不由人
天命终不由人 2020-12-15 01:58

I have been developing an Android application and I need to execute 1 task every hour. I uses the following code for it:

private static final long ALARM_PERI         


        
4条回答
  •  一个人的身影
    2020-12-15 02:42

    Instead of Alram-Manager I recommended you to use Android-TimerTask

    The TimerTask class represents a task to run at a specified time. The task may be run once or repeatedly. Its perfect suits for your requirements.

提交回复
热议问题