Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.79 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. All the accepted parameters to add an event in Android Calendar with an Activity
  2. Calendar cal = Calendar.getInstance();              
  3. Intent intent = new Intent(Intent.ACTION_EDIT);
  4. intent.setType("vnd.android.cursor.item/event");
  5. intent.putExtra("beginTime", cal.getTimeInMillis());
  6. intent.putExtra("allDay", false);
  7. intent.putExtra("rrule", "FREQ=DAILY");
  8. intent.putExtra("endTime", cal.getTimeInMillis()+60*60*1000);
  9. startActivity(intent);
  10.        
  11. Intent intent = new Intent(Intent.ACTION_EDIT);
  12. intent.setType("vnd.android.cursor.item/event");
  13. intent.putExtra("title", myStringTitle);
  14. intent.putExtra("description", myStringDescription);
  15. intent.putExtra("eventLocation",myStringLocation);
  16. intent.putExtra("beginTime", myBeginDate.getTimeInMillis());
  17. intent.putExtra("endTime", myEndDate.getTimeInMillis());