Skip to content Skip to sidebar Skip to footer

How To Create Recurring Of Alarm In Android After Taking User Input?

I am an android developer.I am making an application in which I have to take user input like 8:00,9:00,10:00 etc and I have to set alarm for 20 or 30 days for each time user enter

Solution 1:

the following code help you,firstWake the app will run at very fast time,you can specify as your requirements

AlarmManageram= (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);

longinterval= android.text.format.DateUtils.DAY_IN_MILLIS*20;//or 30longfirstWake= System.currentTimeMillis() ;

am.setRepeating(AlarmManager.RTC,firstWake, interval, pendingIntent);

Solution 2:

Maybe you can use another nonrepeating alarm for 20 or 30 days that stops repeating alarms.

Post a Comment for "How To Create Recurring Of Alarm In Android After Taking User Input?"