开发者

Android: Add entry to the calendar

开发者 https://www.devze.com 2023-02-24 00:40 出处:网络
I am trying to add entry to the calendar,but it threwn error. Source code: Intent intent = new Intent(Intent.ACTION_EDIT);

I am trying to add entry to the calendar,but it threwn error.

Source code:

 Intent intent = new Intent(Intent.ACTION_EDIT);
        intent.setType("vnd.android.cursor.item/event");
        intent.putExtra("title", "test");
   开发者_StackOverflow中文版     intent.putExtra("description", "Popis");
        intent.putExtra("eventLocation", "Somewhere");
        intent.putExtra("beginTime", System.currentTimeMillis () + 60 * 60 * 1000);
        intent.putExtra("endTime", System.currentTimeMillis () + 2 * 60 * 60 * 1000);
        startActivity(intent);

Sorry for my English i am beginner. Thanks for answer.


Add the WRITE_CALENDAR use-permission in your AndroidManifest.xml

0

精彩评论

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

关注公众号