Note that there are some explanatory texts on larger screens.

plurals
  1. POCalendar created is not visible in device's calendar application
    primarykey
    data
    text
    <p>I am new to android development</p> <p>I am trying to create a calendar which should be accessible both from the application I create and My android device's calendar application.</p> <p>Let me first give my device information:</p> <p>Android version : 4.3<br> API level of application: 18<br> Device: Asus nexus 7</p> <p>I am creating calendar using code given below</p> <pre><code>ContentValues values = new ContentValues(); values.put( Calendars.ACCOUNT_NAME, "xyz@gmail.com"); values.put( Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL); values.put( Calendars.NAME, "Test Calendar"); values.put( Calendars.CALENDAR_DISPLAY_NAME, "abc calendar"); values.put( Calendars.CALENDAR_COLOR, Color.YELLOW ); values.put( Calendars.CALENDAR_ACCESS_LEVEL, Calendars.CAL_ACCESS_OWNER); values.put( Calendars.OWNER_ACCOUNT,"xyz@gmail.com"); values.put( Calendars.CALENDAR_TIME_ZONE, TimeZone.getDefault().getID()); values.put(Calendars.VISIBLE, 1); Uri.Builder builder = CalendarContract.Calendars.CONTENT_URI.buildUpon(); builder.appendQueryParameter( Calendars.ACCOUNT_NAME,"xyz@gmail.com"); builder.appendQueryParameter( Calendars.ACCOUNT_TYPE, CalendarContract.ACCOUNT_TYPE_LOCAL); builder.appendQueryParameter( CalendarContract.CALLER_IS_SYNCADAPTER, "true"); Uri uri =this.cordova.getActivity().getContentResolver().insert(builder.build(), values); try { return calendarArray.put(new JSONObject().put("calendarURI", uri)); } catch (JSONException e) { e.printStackTrace(); } return null; </code></pre> <p>when I run the code in application the calendar gets created but after that when I check my device, no new calendar created is visible there then.</p> <p>I have tried like setting Calendars.VISIBLE property with value 1. and also searched for the solutions online but got nothing.</p> <p>The code has been copied from the <a href="http://www.grokkingandroid.com/androids-calendarcontract-provider/" rel="nofollow">link</a></p> <p>Please help me out here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload