Narayanan S
Narayanan S

Reputation: 163

How to set alarm time based on current time?

I want to set an alarm after 5 min of current time in my application.I am using calendar.getMinutes()+5 to get the current time (minutes).But its not working.can anybody tell me where I am doing wrong?

Upvotes: 0

Views: 346

Answers (1)

punam
punam

Reputation: 21

Calendar cal = Calendar.getInstance();
// add 5 minutes to the calendar object
cal.add(Calendar.MINUTE, 5);

Upvotes: 2

Related Questions