Re: [android-developers] Duplicate Calendar Event

2012-03-14 Thread giles ian
thanks a lot Mike On Wed, Mar 14, 2012 at 12:43 PM, Michael Chan wrote: > Have a look at "Querying a calendar" in the link I gave you and > replace the following: > > Uri uri = Events.CONTENT_URI; > String selection = Events.TITLE + " = ? AND " >+ Events.DTS

Re: [android-developers] Duplicate Calendar Event

2012-03-14 Thread Michael Chan
Have a look at "Querying a calendar" in the link I gave you and replace the following: Uri uri = Events.CONTENT_URI; String selection = Events.TITLE + " = ? AND " + Events.DTSTART + " = ? AND " + Events.DTEND + " = ?"; S

Re: [android-developers] Duplicate Calendar Event

2012-03-13 Thread giles ian
Thanks Mike you your answer. Now my question is how do i check if a particular event is already present. Basically i want a select with where clause (for title,start date and end date) On Wed, Mar 14, 2012 at 12:01 AM, Michael Chan wrote: > Hi Giles, > > The code below will add an event every

Re: [android-developers] Duplicate Calendar Event

2012-03-13 Thread Michael Chan
Hi Giles, The code below will add an event every time onClick is called since it's doing an insert(). If you want to modify an existing event, you need to get the event id via a query then do an update. Search for "Updating Events" in http://developer.android.com/guide/topics/providers/calendar-p

[android-developers] Duplicate Calendar Event

2012-03-13 Thread giles ian
Hi, I am using the below code for adding events. Now the issue is im able to add same event (all details same) multiple times. How to i avoid this. > public static void addToCalendar(Context ctx, final String title, > > final long dtstart, final long dtend) { > > final ContentResolver cr = ct