Note that there are some explanatory texts on larger screens.

plurals
  1. POError in Calendar application for insert events
    text
    copied!<pre><code>String[] projection = new String[] { "_id", "name" }; Log.d("projection",""+projection); Uri calendars = Uri.parse("content://com.android.calendar/calendars"); Cursor managedCursor = managedQuery(calendars, projection, null, null, null); if (managedCursor.moveToFirst()) { /* String calName; String calId;*/ int nameColumn = managedCursor.getColumnIndex("name"); Log.d("nameColumn",""+projection); int idColumn = managedCursor.getColumnIndex("_id"); do { calName = managedCursor.getString(nameColumn); Log.d("name",""+calName); calId = managedCursor.getString(idColumn); Log.d("calId",""+calId); } while (managedCursor.moveToNext()); } try{ ContentValues event = new ContentValues(); event.put("calendar_id", calId); Log.d("calId",""+calId); event.put("title", "Event Title"); event.put("description", "Event Desc"); event.put("eventLocation", "Event Location"); Calendar c = Calendar.getInstance(); long date = c.getTimeInMillis(); Log.d("date",""+date); event.put("dtstart", date); Log.d("date",""+date); event.put("dtend", date); Log.d("date",""+date); event.put("allDay", 1); event.put("eventStatus", 1); event.put("visibility", 0); event.put("transparency", 0); event.put("hasAlarm", 1); Uri eventsUri = Uri.parse("content://com.android.calendar/events"); Log.d("eventsUri",""+eventsUri); Uri url = getContentResolver().insert(eventsUri, event); } catch ( IllegalArgumentException e){ System.out.println(e.getMessage()); } </code></pre> <p>Results in the error:</p> <pre><code>java.lang.IllegalArgumentException: Event values must include an event Timezone </code></pre>
 

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