Android Question Calendar insert intent

rboeck

Well-Known Member
Licensed User
Longtime User
Hi,

currently i try to work with intents, to open the users calendar and insert an event from my app.

Here is my code:
B4X:
Sub btnCal_Click
   
Dim i As Intent
Dim a As String
i.Initialize(i.ACTION_EDIT, a)  
i.SetType("vnd.android.cursor.item/event")
i.SetComponent("com.android.calendar/com.android.calendar.LaunchActivity")
i.PutExtra("title","Testtitel")
i.PutExtra("description","Beschreibung")
StartActivity(i)
   
End Sub

With this code, the calendar starts and stays on the current day;
i have found the following java code:

B4X:
Intent calIntent = new Intent(Intent.ACTION_INSERT);
calIntent.setType("vnd.android.cursor.item/event");
calIntent.putExtra(Events.TITLE, "My House Party");
calIntent.putExtra(Events.EVENT_LOCATION, "My Beach House");
calIntent.putExtra(Events.DESCRIPTION, "A Pig Roast on the Beach");
startActivity(calIntent);

So my question is:
I think, i would need an ACTION_INSERT, is there is no possibility to realize this java code in b4a?
 

rboeck

Well-Known Member
Licensed User
Longtime User
I wanted to use the calendar interface; with the calendar lib you have to design and create the calendar yourself. And currently, i think, google is a little better in interface design than i ;-)
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I don't quite know what the issue is, I've used the Lib and it seems effortless to use, but maybe we're doing different things..
 
Upvote 0
Top