A J
A J

Reputation: 4632

calender object in android

 Calendar cal = Calendar.getInstance();
 cal.add(Calendar.SECOND, 10);
 Intent intent = new Intent(Login_activity.this, EnqueryNotification_Service.class);
 PendingIntent pintent = PendingIntent.getService(Login_activity.this, 0, intent, 0);
 AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
 alarm.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 36000 * 1000, pintent);

what is this cal.add(Calendar.SECOND, 10); 10 stands for?

Upvotes: 0

Views: 47

Answers (2)

ZeusNet
ZeusNet

Reputation: 720

With this function you are adding 10 seconds to this calendar object. You should have a look at the Calendar API Reference

Cheers

Upvotes: 0

XorOrNor
XorOrNor

Reputation: 8978

cal.add(Calendar.SECOND, 10); adds 10 seconds to the current Calendar instance.

Upvotes: 2

Related Questions