Question

Can anyone explain me about each term that I have used in working with calendar events?

  1. Uri event_uri = Uri.parse("content://com.android.calendar/" + "events");
    What is uri here, what actually is content, as we can initialize int value to 0? Is it
    possible to initialize a uri with a default value?

  2. Uri reminder_uri = Uri.parse("content://com.android.calendar/" + "reminders");
    What signifies these uri? What are the differences between event_uri and reminder_uri?

  3. ContentValues values = new ContentValues();
    values.put("calendar_id", 1);
    values.put("title", str);
    values.put("description", m_strDescription);

    What does the first one do? values.put("calendar_id", 1);

  4. ContentResolver cr = getContentResolver();
    What is the use of the content resolver? Sometimes we write:

    Uri u = cr.insert(event_uri, values)
    What is this uri? How does it differ from the first two uris e.g event_uri and reminder_uri

    Again values.put("event_id", Long.parseLong(event.getLastPathSegment())); cr.insert(remindar_uri, values);

    What does it do?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top