Google Calendar Android App - Sync Issue

I am trying to create an Android application that interacts with Google Calendar.
I followed the tutorial using the content providers from here . Parts of this code are explained here .

I have encountered the following problems.

  • I created a new TestCalendar from my online application from my laptop and marked it as Selected. When I request my calendars from the application, I see this new calendar, but it appears as unselected (selected = 0). Any suggestions on why this might happen?

  • From my application, I add an event to the calendar using getContentResolver().insert(eventsUri, event);
    The event is reflected in the calendar by phone, but it is not reflected in the online version. To start this new event on the Internet, I need to manually synchronize the calendar or enable auto-synchronization, which, in my opinion, is not the right way in which this should be done. Any suggestions / links that could help?

+6
source share
1 answer

1) Can you reset your calendar and post the result?

Note:
Android <API Lvl 14 you must set selected = 1
Android> Lvl API 14 you must set visibility = 1 (the selected one is no longer available)

Dump:

 cursor = contentResolver.query(Uri.parse(CALENDAR_URI),null, null, null,null); while (cursor.moveToNext()) { for (int i = 0; i < cursor.getColumnCount(); i++) { Log.e("XXX", cursor.getColumnName(i) + ": " + cursor.getString(i)); } } 

CALENDAR_URI = content: //com.android.calendar/calendars (starting with Froyo) or content: // calendar / (before Froyo)

2) fooobar.com/questions/913274 / ...

+1
source

Source: https://habr.com/ru/post/913273/


All Articles