2011-08-23 3 views

답변

4

다음과 같이하십시오. 여기서 startDate는 시작하려는 시간입니다.

long startTime,endTime; 

    String startDate = "2011-09-01"; 
    try { 
     Date date = new SimpleDateFormat("yyyy-MM-dd").parse(startDate); 
     startTime=date.getTime(); 
    } 
    catch(Exception e){ } 

    Calendar cal = Calendar.getInstance(); 
    Intent intent = new Intent(Intent.ACTION_EDIT); 
    intent.setType("vnd.android.cursor.item/event"); 
    intent.putExtra("beginTime",startTime); 
    intent.putExtra("allDay", true); 
    intent.putExtra("rrule", "FREQ=YEARLY"); 
    intent.putExtra("endTime", endTime); 
    intent.putExtra("title", "A Test Event from android app"); 
    startActivity(intent); 
+0

어떻게 캘린더 이벤트에 URI를 추가 할 수 있습니까? 제발 도와주세요. 캘린더 이벤트에서 내 앱을 시작하고 싶습니다. –

1

당신은뿐만 아니라 putextra ("BEGINTIME") 전 세트 (년, 월, 일, hourofday, minofday) 방법과 일정 인스턴스를 사용할 수 있습니다;

관련 문제