开发者

How to Call Calendar in my Application using Intents?

开发者 https://www.devze.com 2023-03-07 01:55 出处:网络
How to Call 开发者_开发技巧Calendar in my Application using Intents?You need an Intent that looks something like this:

How to Call 开发者_开发技巧Calendar in my Application using Intents?


You need an Intent that looks something like this:

Intent calendarIntent = new Intent(Intent.ACTION_EDIT);  
calendarIntent.setType("vnd.android.cursor.item/event");
calendarIntent.putExtra("title", "Title");
calendarIntent.putExtra("beginTime", startTimeMillis);
calendarIntent.putExtra("endTime", endTimeMillis);
calendarIntent.putExtra("description", "Description");

You can then start it by calling this:

startActivity(calendarIntent);


Do you mean the calendar app or the form for adding a new event to the calendar?

Either way. Refer to this answer:

how can i open the calendar from my app?

0

精彩评论

暂无评论...
验证码 换一张
取 消