android-calendar

Android CalendarContract.Instances table returns old values

↘锁芯ラ 提交于 2021-01-28 11:47:59
问题 I am querying the CalendarContract.Instances table to read all calendar event instances within a time interval (curr_time, next_time), as shown in the code below. This code works when the calendar entries have been around for a while. However, if I add a new entry, change an existing entry, or delete it, I get some old/stale entries (e.g., a new entry is not returned when it should be, or the unmodified/deleted entry is still returned), and this happens consistently. This problem occurs on my

Android CalendarContract.Instances table returns old values

断了今生、忘了曾经 提交于 2021-01-28 11:37:30
问题 I am querying the CalendarContract.Instances table to read all calendar event instances within a time interval (curr_time, next_time), as shown in the code below. This code works when the calendar entries have been around for a while. However, if I add a new entry, change an existing entry, or delete it, I get some old/stale entries (e.g., a new entry is not returned when it should be, or the unmodified/deleted entry is still returned), and this happens consistently. This problem occurs on my

Calendar returning duplicate Holiday Events

怎甘沉沦 提交于 2021-01-28 04:17:55
问题 I have found, that when has two accounts linked to their device, and both accounts are syncing their calendars, and both accounts are setup to show the Google Holiday calendar, then the `CalendarContract.Instances` is returning each holiday twice, once for each calendar. Therefore you will see in such cases, that most Calendar apps, other than Google Calendar, will show the Holiday twice, once per calendar. I looked at the underlying Sqlite database, and in the `Calendar` table, there is a

Calendar Provider: Permission Denial on Android 8

女生的网名这么多〃 提交于 2020-06-23 03:40:07
问题 I'm experiencing app crashes on Oreo Android 8.0/8.1 devices when using the calendar provider. The problem does not show on my devices running Nougat and below. Permission Denial: reading com.android.providers.calendar.CalendarProvider2 uri content://com.android.calendar/calendars from pid=8522, uid=10197 requires android.permission.READ_CALENDAR, or grantUriPermission() What puzzles me is that crashes happen even though the system requests persmissions in runtime, they are confirmed by the

Remove or filter duplicate holidays events from calendar database - Android

安稳与你 提交于 2020-06-01 03:22:31
问题 I am fetching all calendar events including holidays from Android Calendar Database using Content providers. As I am signed in with two different Gmail accounts , the Query returns duplicate holidays . I want to avoid duplicate Holidays and I am trying to do the same by making changes in Query. Is it possible to avoid duplicate holidays by making changes in the query? Can someone help me with making a proper query which by default avoids duplicate Holidays? Or is there any other solution for

Remove or filter duplicate holidays events from calendar database - Android

余生颓废 提交于 2020-06-01 03:21:41
问题 I am fetching all calendar events including holidays from Android Calendar Database using Content providers. As I am signed in with two different Gmail accounts , the Query returns duplicate holidays . I want to avoid duplicate Holidays and I am trying to do the same by making changes in Query. Is it possible to avoid duplicate holidays by making changes in the query? Can someone help me with making a proper query which by default avoids duplicate Holidays? Or is there any other solution for

Remove or filter duplicate holidays events from calendar database - Android

天涯浪子 提交于 2020-06-01 03:21:06
问题 I am fetching all calendar events including holidays from Android Calendar Database using Content providers. As I am signed in with two different Gmail accounts , the Query returns duplicate holidays . I want to avoid duplicate Holidays and I am trying to do the same by making changes in Query. Is it possible to avoid duplicate holidays by making changes in the query? Can someone help me with making a proper query which by default avoids duplicate Holidays? Or is there any other solution for

Android Calendar Provider does not return latest data

爷,独闯天下 提交于 2020-05-16 22:39:07
问题 I am using the following code: String selection = "((dtstart >= " + now + ") AND (dtend <= " + endTime.getTimeInMillis() + "))"; Cursor cursor = context.getContentResolver() .query(Uri.*parse*("content://com.android.calendar/events"), *PROJECTION*, selection,null, null); And I notice that once I add/remove an Event to Google Calendar app on the device and run the above code immediately, occasionally I do not get the latest dataset from the Cursor . I have to manually refresh the Google

Android show the datepicker(end date) greater than the start date?

我只是一个虾纸丫 提交于 2020-02-04 02:53:25
问题 Hello guys i want to show the date picker(end date) after the date select from the start date.The end date picker will display date after the from date.End date will display date picker after the from date and before from date will not gonna show .what i got to do? What i am trying is fromdate = (EditText) findViewById(fromDate); todate = (EditText) findViewById(R.id.todate); fromdate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) {

Android Calendar illegalArgumentException when calendar.month set to 1

梦想的初衷 提交于 2020-01-30 02:42:10
问题 The code below works fine except when calendar.MONTH set to 1 (Feb) ,and I do not know why ? Thanks. Calendar calendar = Calendar.getInstance(); calendar.setLenient(false); calendar.set(Calendar.YEAR, 2013); calendar.set(Calendar.MONTH, 1); // Only when "Feb" failed with illegalArgumentException int maxDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); <= If Calendar.MONTH set to 1, this line will "java.lang.IllegalArgumentException" 回答1: You're getting the current date in getInstance.