DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Moderator: Martin
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
hi anuraag
after a long time I have got right solution.
thanks a lot. I want to delete files using start activity action. I am trying. but no success. any suggestions?
thanks a lot for post. from record4
after a long time I have got right solution.
thanks a lot. I want to delete files using start activity action. I am trying. but no success. any suggestions?
thanks a lot for post. from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Use delete files action instead. Set Files to Variable {file_path}.
Edit: example flow.
I have removed explicit component from start activiry. This will work for any file type.
http://automagic4android.com/flow.php?i ... 2df6750845
Edit: example flow.
I have removed explicit component from start activiry. This will work for any file type.
http://automagic4android.com/flow.php?i ... 2df6750845
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
hi anuraag
working amazing. thank a lot.
thanks from record4
working amazing. thank a lot.
thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Hi
How can I get calendar event id in below {event_id}
to edit calendar event using start activity action.
How can I get calendar events list?
Thanks from From record4
How can I get calendar event id in below {event_id}
to edit calendar event using start activity action.
Code: Select all
content://com.android.calendar/events/{event_id}
Thanks from From record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Use query content provider, from example choose list all calendar events. Change the triggertime on both braces to the specific range of time you need. You can prepare it in another variable first. Or you can just addDays directly to the triggertime
This will show calendar events from now to 30 days later.
At the projection, check any field you want to use. In this case, of course you must check _id.
Change the result type to the type you want. You might want to use Table type, so you get nested list you can work with. Use debug dialog to check the value afterward.
Code: Select all
content://com.android.calendar/instances/when/{triggertime}/{addDays(triggertime,30)}
At the projection, check any field you want to use. In this case, of course you must check _id.
Change the result type to the type you want. You might want to use Table type, so you get nested list you can work with. Use debug dialog to check the value afterward.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Hi Desmanto
Thanks a lot. Also I want to know is there any way to delete events.
from record4
Thanks a lot. Also I want to know is there any way to delete events.
from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
I don't think there is a way to delete it, since it is query content provider, not for delete.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Using java code it can be deleted. You can get eventID from query content provider.
Code: Select all
eventID = 201;
cr = callJavaMethod(getContext(), "android.content.Context", "getContentResolver()");
deleteUri = callJavaStaticMethod("android.content.ContentUris", "withAppendedId(android.net.Uri, long)", getJavaStaticField("android.provider.CalendarContract$Events", "CONTENT_URI"), eventID);
rows = callJavaMethod(cr, "android.content.ContentResolver", "delete(android.net.Uri, java.lang.String, java.lang.String[])", deleteUri, null, null)
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
Hi anuraag
Working Amazing. But it delete repeated events also.
For example. I have created an event to remind me every day title named "Call to my bro" id is for example 444. If I delete this event id 444 it was deleting upcoming events also named "Call to my bro". How can I prevent this?
I think that I have explained better.
Thanks from record4
Working Amazing. But it delete repeated events also.
For example. I have created an event to remind me every day title named "Call to my bro" id is for example 444. If I delete this event id 444 it was deleting upcoming events also named "Call to my bro". How can I prevent this?
I think that I have explained better.
Thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: DIY-Actions/Triggers: Start Activity, General Broadcast, ...
@Rafi4
This code is working.
Get first below 6 variables from queryContentProvider.
Source
https://github.com/LineageOS/android_pa ... .java#L361
You should also use Request sync action of Automagic to reflect changes in Google calendar.
This code is working.
Get first below 6 variables from queryContentProvider.
Code: Select all
event_id = "";
calendar_timezone = "";
allDay = "";
begin = "";
_sync_id = "";
rrule = "";
cr = callJavaMethod(getContext(), "android.content.Context", "getContentResolver()");
if (rrule == null) {
uri = callJavaStaticMethod("android.content.ContentUris", "withAppendedId(android.net.Uri, long)", getJavaStaticField("android.provider.CalendarContract$Events", "CONTENT_URI"), event_id);
callJavaMethod(cr, "android.content.ContentResolver", "delete(android.net.Uri, java.lang.String, java.lang.String[])", uri, null, null)
} else {
values = callJavaConstructor("android.content.ContentValues", "ContentValues()");
callJavaMethod(values, "android.content.ContentValues", "put(java.lang.String, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$EventsColumns", "EVENT_TIMEZONE"), calendar_timezone);
callJavaMethod(values, "android.content.ContentValues", "put(java.lang.String, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$EventsColumns", "ALL_DAY"), allDay);
callJavaMethod(values, "android.content.ContentValues", "put(java.lang.String, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$EventsColumns", "DTSTART"), begin);
callJavaMethod(values, "android.content.ContentValues", "put(java.lang.String, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$EventsColumns", "ORIGINAL_SYNC_ID"), _sync_id);
callJavaMethod(values, "android.content.ContentValues", "put(java.lang.String, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$EventsColumns", "ORIGINAL_INSTANCE_TIME"), begin);
callJavaMethod(values, "android.content.ContentValues", "put(java.lang.String, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$EventsColumns", "STATUS"), getJavaStaticField("android.provider.CalendarContract$EventsColumns", "STATUS_CANCELED"));
uri = callJavaStaticMethod("android.net.Uri", "withAppendedPath(android.net.Uri, java.lang.String)", getJavaStaticField("android.provider.CalendarContract$Events", "CONTENT_EXCEPTION_URI"), event_id);
callJavaMethod(cr, "android.content.ContentResolver", "insert(android.net.Uri, android.content.ContentValues)", uri, values);
}
https://github.com/LineageOS/android_pa ... .java#L361
You should also use Request sync action of Automagic to reflect changes in Google calendar.