I'm trying to open my android application from calendar event using 
CUSTOM_APP_URI Here is the code i used for inserting the events into 
calendar

@Overrideprotected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Calendar beginCal = Calendar.getInstance();
    beginCal.set(2015, 11, 10, 4, 30);
    long startTime = beginCal.getTimeInMillis();

    Calendar endCal = Calendar.getInstance();
    endCal.set(2015, 11, 10, 4, 30);
    long endTime = endCal.getTimeInMillis();

    ContentValues values = new ContentValues();
    values.put(CalendarContract.Events.CALENDAR_ID, 1);
    values.put(CalendarContract.Events.TITLE, "Check Demo Calendar4");
    values.put(CalendarContract.Events.DTSTART, startTime);
    values.put(CalendarContract.Events.DTEND, endTime);
    values.put(CalendarContract.Events.EVENT_TIMEZONE, 
TimeZone.getDefault().getID());

    values.put(CalendarContract.Events.CUSTOM_APP_PACKAGE, getPackageName());
    values.put(CalendarContract.Events.CUSTOM_APP_URI, "calendar://1");

    getContentResolver().insert(CalendarContract.Events.CONTENT_URI, values);
}

Problem is even after inserting the event, calendar doesn't show the URI in 
my calendar event page. What is wrong inserting the event with 
CUSTOM_APP_URI? Any help?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d1539e05-611a-4a60-b2f1-ed271217c3b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to