tags:

views:

20

answers:

1

Hi All,

While developing an alarm based application, i have stuck in a scenario.

When my alarm is fired, i can receive the event in BroadCastReceiver::onReceive(). Within this function, i want to notify/call a function, which is located on MainActivity.

How to achieve the same??

A: 

Can't you just move the function to it's own class and call it from both your Activity AND your Receiver?

Dave
When the alarm is invoked , i want to reset all alarms , and create new alarms depending on the present system time.
Yaaga
Sounds like you're doing something very similar to something I'm working on at the moment which uses Alarms.I never set more than one alarm at a time, instead my alarmsetting code always decides what the next alarm time will be and sets just one alarm.. when it goes off, in the broadcast receiver after its created a notification it then finds the next time an alarm should go off and sets a new alarm..This way I'm always only working with ONE pending intent making it much easier to cancel/set
Dave