Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Calendar
    primarykey
    data
    text
    <p>I am trying to put items into a calendar and can't really find out how to code it. This is what I have so far but it inserts it into the main calendar.</p> <pre><code> String calName; String calId = null; String[] projection = new String[] { "_id", "name" }; Uri calendars = Uri.parse("content://calendar/calendars"); Cursor managedCursor = managedQuery(calendars, projection, null, null, null); ContentValues event = new ContentValues(); event.put("calendar_id", calId); event.put("title", strTitle); event.put("description", strDescription); event.put("eventLocation", strLocation); event.put("dtstart", StartTime); event.put("dtend", EndTime); Uri eventsUri = Uri.parse("content://calendar/events"); Uri calUri = getContentResolver().insert(eventsUri, event); </code></pre> <p>So my questions are:</p> <ol> <li><p>How do I create my own calendar to put events into</p></li> <li><p>How do I insert my events into that calendar (using the code above or a new code)</p></li> <li><p>How do I check to see if event already exists</p></li> </ol> <p>~~~UPDATE:~~~</p> <p>What I'm trying to do is my users will enter in an title and a date and my app will take that title and date, put them into a database (so far all that I have done) and now I want to take the title and date and put them into a special calendar devoted for just my apps events. First thing I need to do is have the app create a new calendar. Than insert events into that calendar which the code below helps me do kind of. Still playing with it. Than I want to rerun my app and check to see if the event exists. Thats all.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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