开发者

Android: Add entry to the calendar

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜