How to cancel the timer and renew the same timer?

前端 未结 3 996
南笙
南笙 2021-01-25 16:31

I am creating an app that vibrate and beep every 30 sec and when I log out the vibrate and beep must be cancelled and when I log in the vibrate and beep should resume.

3条回答
  •  再見小時候
    2021-01-25 16:45

    Set timer instance to null when you logout and then initialize it everytime user logged in the app. This will fix the "Timer was cancelled" related issues.

提交回复
热议问题