android-calendar

Get events from all accounts of the device and only events for today

↘锁芯ラ 提交于 2019-12-23 03:55:30
问题 I need to get the number of events on the calendars for today. Only the number of events of all calendars, do not need anything more. I found several threads about it, but I can not get the number of events for today. using this code, the variable "events" gives me the number of all events in the first calendar. int events=0; public void read() { Context context = getApplicationContext(); ContentResolver contentResolver = context.getContentResolver(); long ntime = System.currentTimeMillis();

Android Calendar timezone not changing with CalendarContract

扶醉桌前 提交于 2019-12-23 01:51:17
问题 I am using the following code to add an event to the calender Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra(Events.TITLE, "my event title"); intent.putExtra(Events.EVENT_LOCATION, "my city"); intent.putExtra(Events.DESCRIPTION, "description of this event"); intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, dep.getTimeInMillis()); intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, arr.getTimeInMillis()); intent

Android- Remove Calendarview from DatePickerDialogFragment

邮差的信 提交于 2019-12-22 08:46:28
问题 I have a Datepickerdialog fragment which works fine.When i click the button the datepickerdialog opens whixh has spinner date selection on the left side and calendar view on the right side. For my app in one place i want just the spinner date selection part alone to be shown(calendar view part must be removed or hidden) In other place i want calendar view part must be shown and the spinner date selection must be hidden or removed. But i tried a lot with various things like for hiding calendar

add calendar event without opening calendar

╄→尐↘猪︶ㄣ 提交于 2019-12-21 21:34:58
问题 In my app, the user can set up to 3 reminders for a task, but every time I press the "set reminder" button it opens up the calendar app. Is there any way to set the calendar events without opening the default calendar app? I just want to add an event without starting the calendar activity. This is what my code looks like now: Calendar beginTime = Calendar.getInstance(); beginTime.set(2013, Calendar.MAY, 10, 3, 00); startMillis = beginTime.getTimeInMillis(); Calendar endTime = Calendar

How to read reminders in google calendars

不打扰是莪最后的温柔 提交于 2019-12-21 09:28:49
问题 I'm trying to read the reminders set by the user. What I mean with "reminder": currently there are two different meaning, the first one is the "alert" related to each event in the calendar and you can read them from CalendarContract.Reminders , the second one are unrelated events inserted by the user via Google Now with "remember me to...." or via Google Calendar app with insert reminder action. I'm talking about the second one. I'm reading from the event table CalendarContract.Events .

How to read reminders in google calendars

痴心易碎 提交于 2019-12-21 09:28:43
问题 I'm trying to read the reminders set by the user. What I mean with "reminder": currently there are two different meaning, the first one is the "alert" related to each event in the calendar and you can read them from CalendarContract.Reminders , the second one are unrelated events inserted by the user via Google Now with "remember me to...." or via Google Calendar app with insert reminder action. I'm talking about the second one. I'm reading from the event table CalendarContract.Events .

PhoneGap/Cordova calendar integration (Android)

蓝咒 提交于 2019-12-21 05:27:09
问题 I'm building an Android app using PhoneGap (aka Cordova), and am having trouble getting a calendar integration to work. Disclaimer: I'm a noob to both Android and PhoneGap, please bear with me. All I'm trying to do is add an event to the user's calendar. Following this tutorial, I've created a Plugin that attempts to launch a Calendar Intent. The code looks like this: public class CalendarPlugin extends Plugin { public static final String NATIVE_ACTION_STRING="addToCalendar"; public static

CalendarView takes much time for displaying

独自空忆成欢 提交于 2019-12-20 14:44:01
问题 i am working on an application on CalendarView. i have to show calendarView in a small linear-layout. problem occurs while displaying a whole page which contains calendarView in small Linear-layout. -> this takes 10 seconds to show,& this is much time... there is no other thing in layout. here is my xml and snap... any help would be strongly appriciated... <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width=

Deleting events from Calendar not being deleted

心不动则不痛 提交于 2019-12-20 11:08:14
问题 I am trying to make my App add reminders to the user's Calendar. The code searches for the title and start date to check if the event already exists in the Calendar before adding it (so as not to have duplicates). My problem is that: if I remove the event from the Calendar manually (using the Calendar), the event disappears from the Calendar (I am viewing all my Calendars and can't see it in the Calendar Application) but not from the DataBase. Another thing I don't understand is that I tried

How to get day, month, year and hour, minutes, second from DateTime format?

孤者浪人 提交于 2019-12-20 06:54:07
问题 I tried this following code but its a deprecated in android SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); try { Date date1 = simpleDateFormat.parse("11/20/2014 8:10:00 AM"); Log.e("date", "" + date1.getYear()); Log.e("month", "" + date1.getmonth()); Log.e("year", "" + date1.getYear()); Log.e("hour", "" + date1.getHours()); Log.e("minutes", "" + date1.getMinutes()); Log.e("seconds", "" + date1.getSeconds()); } catch (ParseException e) { // TODO Auto-generated