Skip to content Skip to sidebar Skip to footer

Java.lang.IllegalArgumentException: Bad Class: Class Java.lang.String?

Please I get this error that I do not understand. This is the code: Cursor cursor = context.getContentResolver() .query(Uri.parse('content://com.android.calendar/events

Solution 1:

Read the API Guide on Calendar Provider to know about accessing the calendar events.

The mistakes you are making are:

  • Do not use hard coded string literals ("dtstart", ..); use the constants defined in CalendarContract.EventsColumns for the column names.
  • The DTSTART and DTEND columns contain the start and end time in long format (milliseconds since epoch).

Post a Comment for "Java.lang.IllegalArgumentException: Bad Class: Class Java.lang.String?"