Delete Calendar Event
Moderator: Martin
Delete Calendar Event
Hi, how can i delete an event from the calendar with the Action: Start Activity?
Re: Delete Calendar Event
Hi,
I fear that it's not possible to delete a calendar entry with action Start Activity. The calendar app seems not to support the delete-intent (at least not the calendar app from Google).
For the moment you probably have to resort to Execute Root Command with a command like content delete --uri content://com.android.calendar/events/751 where 751 is the ID of the event you want to delete.
Regards,
Martin
I fear that it's not possible to delete a calendar entry with action Start Activity. The calendar app seems not to support the delete-intent (at least not the calendar app from Google).
For the moment you probably have to resort to Execute Root Command with a command like content delete --uri content://com.android.calendar/events/751 where 751 is the ID of the event you want to delete.
Regards,
Martin
Re: Delete Calendar Event
Thanks Martin for answering so fast, I will try Execute Root Command.
Regards,
Alfredo.
Regards,
Alfredo.
Updating a Calendar Event without editing it
Hi Martin, how can I do this with Automagic:
"Updating Events
When your application wants to allow the user to edit an event, we recommend that you use an EDIT Intent, as described in Using an intent to edit an event. However, if you need to, you can edit events directly. To perform an update of an Event, you can provide the _ID of the event either as an appended ID to the Uri (withAppendedId()) or as the first selection item. The selection should start with "_id=?", and the first selectionArg should be the _ID of the event. You can also do updates using a selection with no ID. Here is an example of updating an event. It changes the title of the event using the withAppendedId() approach:
private static final String DEBUG_TAG = "MyActivity";
...
long eventID = 188;
...
ContentResolver cr = getContentResolver();
ContentValues values = new ContentValues();
Uri updateUri = null;
// The new title for the event
values.put(Events.TITLE, "Kickboxing");
updateUri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
int rows = getContentResolver().update(updateUri, values, null, null);
Log.i(DEBUG_TAG, "Rows updated: " + rows); "
From: http://developer.android.com/guide/topi ... date-event
Regards,
Alfredo.
"Updating Events
When your application wants to allow the user to edit an event, we recommend that you use an EDIT Intent, as described in Using an intent to edit an event. However, if you need to, you can edit events directly. To perform an update of an Event, you can provide the _ID of the event either as an appended ID to the Uri (withAppendedId()) or as the first selection item. The selection should start with "_id=?", and the first selectionArg should be the _ID of the event. You can also do updates using a selection with no ID. Here is an example of updating an event. It changes the title of the event using the withAppendedId() approach:
private static final String DEBUG_TAG = "MyActivity";
...
long eventID = 188;
...
ContentResolver cr = getContentResolver();
ContentValues values = new ContentValues();
Uri updateUri = null;
// The new title for the event
values.put(Events.TITLE, "Kickboxing");
updateUri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
int rows = getContentResolver().update(updateUri, values, null, null);
Log.i(DEBUG_TAG, "Rows updated: " + rows); "
From: http://developer.android.com/guide/topi ... date-event
Regards,
Alfredo.
Re: Delete Calendar Event
Hi Alfredo
Automagic does not provide an action to update values but you could also use the content command using Execute Root Command.
The command in this case would look like this:
content update --uri content://com.android.calendar/events/188 --bind title:s:Kickboxing
188 is the eventId
title:s:Kickboxing tells to update column title with a String (s) to value Kickboxing.
Here's the description provided by command content:
<COLUMN_NAME>:<TYPE>:<COLUMN_VALUE> where:
<TYPE> specifies data type such as:
b - boolean, s - string, i - integer, l - long, f - float, d - double
Note: Omit the value for passing an empty string, e.g column:s:
Regards,
Martin
Automagic does not provide an action to update values but you could also use the content command using Execute Root Command.
The command in this case would look like this:
content update --uri content://com.android.calendar/events/188 --bind title:s:Kickboxing
188 is the eventId
title:s:Kickboxing tells to update column title with a String (s) to value Kickboxing.
Here's the description provided by command content:
<COLUMN_NAME>:<TYPE>:<COLUMN_VALUE> where:
<TYPE> specifies data type such as:
b - boolean, s - string, i - integer, l - long, f - float, d - double
Note: Omit the value for passing an empty string, e.g column:s:
Regards,
Martin
Re: Delete Calendar Event
Thanks Martin, I'll try. I must congratulate you for the great service you have.
Regrads,
Alfredo.
Regrads,
Alfredo.
Re: Delete Calendar Event
Hello. Weird problem. Trying to delete a calendar event with this command
content delete --uri content://com.android.calendar/events/215
I'm getting this error msg in stdout
[ERROR] Unsupported operation: delete --uri content://com.android.calendar/events/215
the device is a sony sgp611 tablet,rooted with kingroot.
Running the same command in a terminal emulator works with no error messages.
I son't know what the problem is. The same action ran on another device-htc phone- works ok.
Maybe it's the rooting methox on the tablet. Any ideeas?
content delete --uri content://com.android.calendar/events/215
I'm getting this error msg in stdout
[ERROR] Unsupported operation: delete --uri content://com.android.calendar/events/215
the device is a sony sgp611 tablet,rooted with kingroot.
Running the same command in a terminal emulator works with no error messages.
I son't know what the problem is. The same action ran on another device-htc phone- works ok.
Maybe it's the rooting methox on the tablet. Any ideeas?
Re: Delete Calendar Event
The command looks good to me. Maybe kingroot messes something up but I'm not aware about problems in this area.
What happens when you just execute an action Execute Root Command: content delete (I would expect an output like [ERROR] Content provider URI not specified. Did you specify --uri argument?).
What about Execute Root Command: content delete --uri (I would expect [ERROR] No value for argument: --uri).
Can you please share the flow containing the action so I can check if I see anything suspicious?
What happens when you just execute an action Execute Root Command: content delete (I would expect an output like [ERROR] Content provider URI not specified. Did you specify --uri argument?).
What about Execute Root Command: content delete --uri (I would expect [ERROR] No value for argument: --uri).
Can you please share the flow containing the action so I can check if I see anything suspicious?
Re: Delete Calendar Event
Actually I solved it. Just works after restarting the tablet. Don't know what that had to do with anything. Thx Martin