I want to make a service which fire alarm manager in every 1 min interval..But my Alarm run once(first time only). I follow Lalit Answer
private class Rec
Try this code in Your broadcast receiver's onReceive method
AlarmManager mgr=(AlarmManager)ctxt.getSystemService(Context.ALARM_SERVICE);
mgr.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),
60000+System.currentTimeMillis(),
getPendingIntent(ctxt));
and you can get pending intent
private static PendingIntent getPendingIntent(Context ctxt) {
Intent i=new Intent(ctxt, AReceiver.class);
return(PendingIntent.getBroadcast(ctxt, 0, i, 0));
}
where AReceiver class is for start service like Notification it is working fine in my app so i hope it helps you