Refer to the code that @Yuri posted from here. How to stop a timer after certain number of times . If I wanted to stop it because of some condition and then restart it agai
FIgured it out, it was because I didn't initialize the task in startManager()