how to edit the calendar events via android application

前端 未结 2 1979
长发绾君心
长发绾君心 2021-01-01 02:47

how can i edit the calendar events in calendar via android application..

Any one know how to open the Agenda Activity in the calendar application.....

2条回答
  •  爱一瞬间的悲伤
    2021-01-01 03:16

    this is the exact answer for this question

        Uri uri = Uri.parse("content://calendar/events");
        long eventId = calendeeventid;
        Uri newuri = ContentUris.withAppendedId(uri, eventId);
        Intent intent = new Intent(Intent.ACTION_VIEW,newuri);
        Cursor cursor = getContentResolver().query(newuri, new String[]{"dtstart","dtend",},null, null, null);
        if(cursor.getCount()>0)
        {   cursor.moveToFirst();
        intent.putExtra("beginTime", cursor.getLong(cursor.getColumnIndex("dtstart")));
        intent.putExtra("endTime",  cursor.getLong(cursor.getColumnIndex("dtend")));
        }
    

提交回复
热议问题