android-calendar

How to get access to the calendars on a Android phone?

主宰稳场 提交于 2019-11-28 02:29:48
I gave some tries to access the calendars on a Android phone, but none of my code worked, is there someone that knows for sure, how to read/query the calendar events for a specified time range? String[] projection = new String[] { CalendarContract.Events.CALENDAR_ID, CalendarContract.Events.TITLE, CalendarContract.Events.DESCRIPTION, CalendarContract.Events.DTSTART, CalendarContract.Events.DTEND, CalendarContract.Events.ALL_DAY, CalendarContract.Events.EVENT_LOCATION }; // 0 = January, 1 = February, ... Calendar startTime = Calendar.getInstance(); startTime.set(2014,00,01,00,00); Calendar

Android Calendar, get Event Id

∥☆過路亽.° 提交于 2019-11-27 21:36:22
i'm writing an application that need to add some events to a calendar in android. For inserting i just used the following code: public void onItemClick(AdapterView<?> adapter, View curview, int position, long id) { WhoisEntry entry = this.adapter.getItem(position); String domainName = entry.getDomainName(); Date expDate = entry.expirationDate; Toast.makeText(getApplicationContext(), "Domain: " + domainName, Toast.LENGTH_SHORT).show(); Calendar cal = Calendar.getInstance(); Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra(

CalendarView Clickable Android

女生的网名这么多〃 提交于 2019-11-27 21:28:59
问题 I am trying to start a new activity when you click on a date in CalendarView but my event doesn't seem to fire. I have set clickable to true and specified an onclick (both in xml) this is the xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <CalendarView android:id="@+id/calendarView1" android:layout_width="match_parent" android:layout_height

How can I add event to the calendar automatically?

独自空忆成欢 提交于 2019-11-27 16:10:10
问题 How can i add event to the calendar automatically? If I use this source code, it opens Calendar with filled entries, but I must click on save button to save it. public class CalendarApplicationActivity extends Activity { public static final String[] EVENT_PROJECTION = new String[] { Calendars._ID, // 0 Calendars.ACCOUNT_NAME, // 1 Calendars.CALENDAR_DISPLAY_NAME // 2 }; private static final int PROJECTION_DISPLAY_NAME_INDEX = 2; @Override public void onCreate(Bundle savedInstanceState) {

Android: CalendarView OnDateChangeLIstener

最后都变了- 提交于 2019-11-27 15:29:27
I've already implemented this listener in order for me to display something when a certain date is clicked, but the problem is that when i scroll the CalendarView down, it automatically displayed something but i didn't click anything, i just scrolled down to anther month in CalendarView and then there goes a, say a Toast or a Log, whichever (I guess it makes sense since the listener itself fires `onDateChange and since scrolling down the calendar also changes the date currently selected). So my question is that is there any listener for CalendarView that i might use just a alternative to

Custom calendar dayview in android

别等时光非礼了梦想. 提交于 2019-11-27 10:10:29
问题 I want to develop a custom calendar day view for android OS 1.5 and later on. Similar to android day calendar and event add & display in day view. If you have example or source of it then please give me. I have no idea how to start. Please guide me. I have done month view as per below link: http://w2davids.wordpress.com/android-simple-calendar/ but I have to also create day view so please help me. I want to display this: 回答1: I just worked on this: You could consider it a blueprint to start.

AlarmManager setInexactRepeating, setWindow, setRepeating methods do not fire alarm when called from within loop for week days

ⅰ亾dé卋堺 提交于 2019-11-27 09:50:59
Requirement :- I need to fire alarm on selected days of a week and a date from which alarms would start(for example I want to fire alarm on Friday and Saturday of every week starting from May 26, 2017 at 6:45 PM) Problem:- BroadcastReceiver's onReceive() method does not executes when AlarmManager setInexactRepeating , setWindow or setRepeating methods are called from within a loop. Code used for this task is mentioned below:- AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hiappz.remindersample">

android: EXDATE format when adding a calendar event

喜你入骨 提交于 2019-11-27 06:55:18
问题 Can someone explain how to use EXDATE when adding event to android calendar? The documentation is pretty unclear about the format in which the EXDATE should be put. I tried many formats, these are some of them: values.put(Events.EXDATE, "TZID=Europe/London:20130116T080000"); values.put(Events.EXDATE, "20130116T080000Z"); values.put(Events.EXDATE, "20130116T080000"); values.put(Events.EXDATE, "20130116"); but none of them works. Any idea how to make an event not appear on a particular date, if

How to get national holidays of selected country

最后都变了- 提交于 2019-11-27 03:06:37
I'm writing an app that allows the user to select a country from a list. When they pick a country, a list of national holidays of that country appears. I've seen CalendarProvider and Google Calendar V3 , but they seem to only provide the current user's calendar. How can I get the national holidays of a specific country? Any suggestion would help me. Update: I've found this post which can get a list of holidays in JSON format. In this example, the country code is defined by calendar ID, for instance pt_br.brazilian#holiday@group.v.calendar.google.com or en.usa#holiday@group.v.calendar.google

Opening Android App from Calendar

本小妞迷上赌 提交于 2019-11-27 02:47:52
问题 The app I'm working on needs to be able to create events in a chosen Calendar and then when the user views these events in their calendar viewing app it offers an option to return to the my app to view more information about it and the data related to it. Using Calendar Provider I'm able to create the events and I store the Uri to the event for later use/removal but I haven't found a good way to open my app from these events in a calendar viewing app. The 2 options that I have considered are