Fehler Einfügen Ereignis in den Kalender ein, mit der Absicht,

Ich versuche zum einfügen von Ereignisse in die calendar aus einem fragment, aber ich bekomme immer eine Fehlermeldung, dass keine Aktivität gefunden wird, um zu behandeln Absicht.

Hier der Fehler -

android.Inhalt.ActivityNotFoundException: Keine Aktivität gefunden zu handhaben Intent { act=android.Absicht.Aktion.INSERT cat=[android.Absicht.Kategorie.APP_CALENDAR] typ=vnd.android.cursor.Element/Ereignis (has extras) }

Hier ist mein code:

Intent intent = new Intent(Intent.ACTION_INSERT);
intent.addCategory(Intent.CATEGORY_APP_CALENDAR);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra(Events.TITLE, "Phototherapy Treatment");
intent.putExtra(Events.EVENT_LOCATION, "");
intent.putExtra(Events.DESCRIPTION, "Phototherapy Treatment");

//Setting dates
Calendar calDate = Calendar.getInstance();
intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,calDate.getTimeInMillis());
intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
calDate.getTimeInMillis()+60*60*1000);

//Make it a full day event
intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, false);

//Make it a recurring Event                    
intent.putExtra(Events.RRULE, "FREQ=WEEKLY;COUNT="+Integer.valueOf(No.getText().toString())+";"
+"WKST=SU;BYDAY="+days);

//Making it private and shown as busy
 intent.putExtra(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);
 intent.putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY);

startActivity(intent);

Vorsatz-Filter

<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 
<action android:name="android.intent.action.INSERT" /> 
<category android:name="android.intent.category.APP_CALENDAR" /> 
<data android:mimeType="vnd.android.cursor.item/event" /> 
</intent-filter>
InformationsquelleAutor MrEngineer13 | 2012-03-29
Schreibe einen Kommentar