I have implemented a simple app that shows notification at particular intervals using alaramManager just as shown here .
I have a static bool shouldNotify
class level variable in main activity.
I need setRepearing
to execute only if my shouldNotify
is true.
How shall it be done?
EDIT:
One way is by notifying on condition(as specified in the first answer), but that will drain the battery as alaram will always be fired. Is there any better option?
Let me know if its too vague to be asked here. I am new to OOP.