나는 새로운 일정을 android calendar에 추가하려고합니다. 여기에 내가 사용하는 코드가있다android 캘린더에 새 항목 삽입하기
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", event.getSummary());
intent.putExtra("description", event.getDescription());
intent.putExtra("eventLocation", event.getLocation());
intent.putExtra("dtstart", event.getStartDate());
if(event.getEndDate() == null)
{
intent.putExtra("allDay", true);
}
else
{
intent.putExtra("dtend", event.getEndDate());
}
startActivity(intent);
나는이 클래스를 액티비티 클래스가 아닌 별도의 클래스에 구현하려고한다. 그래서 여기에서 활동 수업을 연장하고 있습니다.
내가 마지막 줄 startActivity (의도)를 실행할 때; 자바 nullpointer 예외가 나타납니다.
진행 방법이 없습니다.
어떻게하면 Android 캘린더에 항목을 추가 할 수 있습니까? 감사합니다.