0

i need to add some event in calendar,example In Aug-15 i need to add "independence celebration ".one i click Aug-15 have to show "independence celebration ",please help me i am in trouble

1 Answers1

0

There are a lot of questions about same calender events.You should have searched the forum at least once before asking it but since you asked I'm giving you a code which you can understand and modify according to your needs.

Calendar cal = Calendar.getInstance();              
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", cal.getTimeInMillis());
intent.putExtra("allDay", true);
intent.putExtra("rrule", "FREQ=YEARLY");
intent.putExtra("endTime", cal.getTimeInMillis()+60*60*1000);
intent.putExtra("title", "A Test Event from android app");
startActivity(intent);

If you find any difficulty then you can refer to these previously asked questions:

How to add calendar events in Android?

Community
  • 1
  • 1
dark_shadow
  • 3,503
  • 11
  • 56
  • 81