I am attempting to make alarm program. So far I have written an activity in which the user can select the time he wishes the alarm to go off. This is working fine. Now I nee
I assume you are missing registering your receiver in Manifest file, With appropriate action string. as given below.
// can change name/action string as par ur requirement.
you need to set same action string in your intent, Remember Action string must be same in Manifest and here intent.setAction("com.android.whatever.WHAT_EVER_NAM_YOU_WANNA_GIVE");
in java also. then only it will tringger receiver.
Your code can be changed like given below.
Intent intent = new Intent(getApplicationContext(), to_call_when_alarm_goes_off.class);
intent.setAction("com.android.whatever.WHAT_EVER_NAM_YOU_WANNA_GIVE");// added line
PendingIntent pIntent = PendingIntent.getBroadcast(getApplicationContext(),0, intent, 0);
AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarms.cancel(pIntent);
alarms.setRepeating(
AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+1000,
AlarmManager.INTERVAL_DAY,
pIntent);