android - Using AlarmManager to activate and deactivate silence mode -
in program, getting 2 dates user. first date activating silence mode , second date deactivating it. handling issue, have tried use 2 different alarmmanager , 2 different broadcastreceiver couldn't achieve it. can activate silence mode @ first date couldn't deactivate it. part of code: public class addevent extends appcompatactivity { private static pendingintent silenceactivatorpendingintent; private static pendingintent silencedeactivatorpendingintent; private static alarmmanager manager1; private static alarmmanager manager2; @override protected void oncreate(bundle savedinstancestate) { intent silenceactivatorintent = new intent(this, silencemodeactivator.class); intent silencedeactivatorintent = new intent(this, silencemodedeactivator.class); silenceactivatorpendingintent = pendingintent.getbroadcast(this, 0, silenceactivatorintent, 0); silencedeactivatorpendingintent = pendingintent.getbroadcast(this, 0, silenc