Handler postDelayed delayed longer as configured

后端 未结 2 1794
无人共我
无人共我 2021-01-16 15:01

I try to develop a simple timer beeper, that peep hourly. For the timing I use a Service and handler, here the example:

    void onStart(...){
        handle         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-16 15:34

    You'll probably have better luck using the AlarmManager for such a long delay. Handler is best for ticks and timeouts while your app is in the foreground.

    http://developer.android.com/reference/android/app/AlarmManager.html

提交回复
热议问题