I have two class, A, B in these classes. Both of them I have a alarmmanager like next;
class A{
PendingIntent sender;
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
..........
am.set(AlarmManager.RTC_WAKEUP, atTimeInMillis, sender);
}
class B{
// some code like Class A}
Then, both A and B send the PendingIntent to a BroadcastReceiver B.
I think it’s wrong to have two AlarmManger in a Application. can you tell me the truth. I want to do like that, because I want to trigger a notifiction in c instead of a service. because I think service is a waste to do that.in class A I want to trigger something else. Besides what I want to do can’t be do in class A .so I want to do it in class B individually.
Having the alarms in different classes is perfectly fine. You should not encounter any problems doing so!