Android Question [Solved] Add event in calendar using intent

asales

Expert
Licensed User
Longtime User
I use the Calendar lib to put an event in the calendar, but I got a warning from Google about the use of the READ_CALENDAR and READ_CONTACTS permissions:

I want to remove the lib, the permissions and using an intent to put the entry in the calendar:
B4X:
Dim it As Intent
it.Initialize(it.ACTION_EDIT, "")
it.SetType("vnd.android.cursor.item/event")

it.putExtra("Events.TITLE", "New Event Title")
it.putExtra("Events.ALL_DAY", "True")
it.putExtra("Events.DESCRIPTION","Event Description")
it.putExtra("CalendarContract.EXTRA_EVENT_BEGIN_TIME", DateTime.Add(DateTime.Now, 0, 0, 1))
it.putExtra("CalendarContract.EXTRA_EVENT_END_TIME", DateTime.Add(DateTime.Now, 0, 0, 1))
StartActivity(it)
The calendar is opened to edit, but the options in putExtra don't work.

I based in this links:

Is possible to add the entry in calendar using this intent?

Thanks in advance for any tips to fix it.
 
Solution
Solution here:

asales

Expert
Licensed User
Longtime User
Solution here:
 
Upvote 0
Solution
Top