How to using intents to view calendar data?

前端 未结 3 570
一个人的身影
一个人的身影 2020-12-06 14:52

I made this code:

long eventID = 208;
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
Intent intent = new Intent(Intent.ACTION_VIEW)
   .s         


        
3条回答
  •  孤城傲影
    2020-12-06 15:24

    You have to add the event begin & end time to intent's extra data :

    intent.putExtra("beginTime", beginMilliTS);
    intent.putExtra("endTime", endMilliTS);
    

    I got this working by using the values from "begin" and "end" field of an event instance. This should work too with "dtstart" and "dtend" field from an event.

提交回复
热议问题