Use following code for your solution :
and i used comments so you can easily understand
// time at which alarm will be scheduled here alarm is scheduled at 1
// day from current time,
// we fetch the current time in milliseconds and added 1 day time
// i.e. 24*60*60*1000= 86,400,000 milliseconds in a day
Long time = selectedMilli;
// create an Intent and set the class which will execute when Alarm
// triggers, here we have
// given AlarmReciever in the Intent, the onRecieve() method of this
// class will execute when
// alarm triggers and
// we will write the code to send SMS inside onRecieve() method pf
// Alarmreciever class
Intent intentAlarm = new Intent(ScheduleActivity1.this,
AlarmReciever.class);
// create the object
AlarmManager alarmManager = (AlarmManager) this
.getSystemService(Context.ALARM_SERVICE);
// set the alarm for particular time
alarmManager.set(AlarmManager.RTC_WAKEUP, time, PendingIntent
.getBroadcast(this, i, intentAlarm,
PendingIntent.FLAG_UPDATE_CURRENT));
/*
* alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
* time,TimeUnit.MINUTES.toMillis(1), PendingIntent.getBroadcast(this,
* i, intentAlarm,PendingIntent.FLAG_UPDATE_CURRENT));
*/
// alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
// time,AlarmManager.INTERVAL_DAY, PendingIntent.getBroadcast(this, i,
// intentAlarm,PendingIntent.FLAG_UPDATE_CURRENT));
// Toast.makeText(ScheduleActivity1.this,
// "Alarm Scheduled for " + selectedMilli, Toast.LENGTH_LONG)
// .show();