Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have used Following code to add event in my own created calendar </p> <pre><code>public void SyncEvent(long id, int meeting_id, String EventName, String Stime, String Etime, String Description) { Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("GMT-1")); Date dt = null; Date dt1 = null; try { dt = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(Stime); dt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(Etime); Calendar beginTime = Calendar.getInstance(); cal.setTime(dt); // beginTime.set(2013, 7, 25, 7, 30); beginTime.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE)); Calendar endTime = Calendar.getInstance(); cal.setTime(dt1); // endTime.set(2013, 7, 25, 14, 30); // endTime.set(year, month, day, hourOfDay, minute); endTime.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE)); ContentResolver cr = this.mContext.getContentResolver(); ContentValues values = new ContentValues(); values.put(Events.DTSTART, beginTime.getTimeInMillis()); values.put(Events.DTEND, endTime.getTimeInMillis()); values.put(Events.TITLE, EventName); values.put(Events.DESCRIPTION, Description); values.put(Events.CALENDAR_ID, id); // values.put(Events._ID, meeting_id); values.put(Events.EVENT_TIMEZONE, TimeZone.getDefault().getID()); Uri uri = cr.insert(Events.CONTENT_URI, values); long eventID = Long.parseLong(uri.getLastPathSegment()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload