First
of all we need to get the calendar provider uri.........
if (Build.VERSION.SDK_INT >= 8 ) {
l_eventUri = Uri.parse("content://com.android.calendar/events");
} else {
l_eventUri = Uri.parse("content://calendar/events");
}
But below the getCalendarUriBase(this) method is already return to get URI.So no need to use above code.It is just for your understanding.
You'll also need to add these permission to your manifest for this method.........
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
/*
* A device may have more than one Calendar configure in it. So first,
* you must find out available calendar's name and their id.
*/
Cursor cursor = getContentResolver() .query(Uri.parse(getCalendarUriBase(this) ),new String[] { "calendar_id", "displayname" }, null,null, null);
cursor.moveToFirst();
// fetching calendars name
String CNames[] = new String[cursor.getCount()];
// fetching calendars id
int[] CalIds = new int[cursor.getCount()];
for (int i = 0; i < CNames.length; i++) {
CalIds[i] = cursor.getInt(0);
CNames[i] = cursor.getString(1);
cursor.moveToNext();
}
// get calendar
Calendar cal = Calendar.getInstance();
Uri EVENTS_URI = Uri.parse(getCalendarUriBase(this) + "events");
ContentResolver cr = getContentResolver();
// event insert
ContentValues values = new ContentValues();
values.put("calendar_id",CalIds);
values.put("title", "Reminder Title");
values.put("allDay", 0);
values.put("dtstart", cal.getTimeInMillis() + 11*60*1000); // event starts at 11 minutes from now
values.put("dtend", cal.getTimeInMillis()+60*60*1000); // ends 60 minutes from now
values.put("description", "Reminder description");
//Event Id
values.put("_id", scheduleId);
//0~ default; 1~ confidential; 2~ private; 3~ public
values.put("visibility", 0);
//0~ false; 1~ true
values.put("hasAlarm", 1);
//status: 0~ tentative; 1~ confirmed; 2~ canceled
values.put("eventStatus", 1);
//0~ opaque, no timing conflict is allowed; 1~ transparency, allow overlap of scheduling
values.put("transparency", 0);
Uri event = cr.insert(EVENTS_URI, values);
// reminder insert
Uri REMINDERS_URI = Uri.parse(getCalendarUriBase(this) + "reminders");
values = new ContentValues();
values.put( "event_id", Long.parseLong(event.getLastPathSegment()));
values.put( "method", 1 );
values.put( "minutes", 10 );
cr.insert( REMINDERS_URI, values );
// for deleting event
// getContentResolver().delete(path to the content, want to delete,
// CONDITION, ARGUMENTS);
// CONDITION + ARGUMENTS work as where condition to find a particular
event.
getContentResolver().delete(
Uri.parse(getCalendarUriBase(this)),
"calendar_id=? and description=? and eventLocation=? ",
new String[] { String.valueOf(CalIds[0]), "Birthday Party",
"Delhi" });
getCalendarUriBase(this) is the method which provides the ContentProvider uri of Android device base on versions...........which is given below....
private String getCalendarUriBase(Activity act) {
String calendarUriBase = null;
Uri calendars = Uri.parse("content://calendar/calendars");
Cursor managedCursor = null;
try {
managedCursor = act.managedQuery(calendars, null, null, null, null);
} catch (Exception e) {
}
if (managedCursor != null) {
calendarUriBase = "content://calendar/";
} else {
calendars = Uri.parse("content://com.android.calendar/calendars");
try {
managedCursor = act.managedQuery(calendars, null, null, null, null);
} catch (Exception e) {
}
if (managedCursor != null) {
calendarUriBase = "content://com.android.calendar/";
}
}
return calendarUriBase;
}
This comment has been removed by a blog administrator.
ReplyDeleteSteelers vs Patriots
ReplyDeletePatriots vs Steelers
Pittsburgh Steelers vs New England Patriots
New England Patriots vs Pittsburgh Steelers
Steelers vs Patriots Live
Steelers vs Patriots Live Stream
The AFC Championship 2107 Steelers vs Patriots Game will also be on Sunday, starting at 6:40 p.m.
ReplyDeleteSteelers vs Patriots
Patriots vs Steelers
Pittsburgh Steelers vs New England Patriots
New England Patriots vs Pittsburgh Steelers
Steelers vs Patriots Live
Steelers vs Patriots Live Stream
The NCAA Division I Men's Basketball Tournament is a single-elimination competition played each spring in the United States, currently featuring 68 college basketball teams from the Division I level of the National Collegiate Athletic Association (NCAA), to establish the national championship. The event was produced in 1939 by the National Association of Basketball Coaches, as well as was the concept of Ohio State University train Harold Olsen. [1] Played mostly during March, it is understood informally as March Madness or the Big Dance, as well as has become one of one of the most famous yearly showing off occasions in the United States.
ReplyDeleteMarch Madness
March Madness Live
March Madness Live Stream
March Madness 2017
March Madness 2017 Live
NCAA March Madness
2017 March Madness
March Madness Bracket
The competition groups consist of champions from 32 Division I seminars (which obtain automated quotes), and 36 groups which are awarded at-large berths. These "at-large" groups are chosen by an NCAA option committee, then introduced in a country wide televised occasion on the Sunday preceding the First Four play-in games, currently held in Dayton, Ohio, as well as referred to as Selection Sunday. The 68 groups are separated right into four areas and also arranged into a solitary removal " brace", which pre-determines, when a group wins a video game, which team it will encounter next. Each team is "seeded", or ranked, within its area from 1 to 16. After an initial four video games in between 8 lower-ranked groups, the competition happens throughout the program of three weekends, at pre-selected neutral sites across the United States. Teams, seeded by ranking, proceed with a solitary video game removal bracket starting with a first round including 64 groups, to a "Sweet Sixteen", and for the last weekend break of the tournament, a Final Four. The Final Four is usually played throughout the initial weekend break of April. These 4 teams, one from each area (East, South, Midwest, and also West), complete in one area for the championship game.
ReplyDeleteThe spending comes as competition for public research money is fierce and expected to get fiercer, with funding for the NIH expected to plateau and even drop in coming years.
March Madness
March Madness Live
March Madness Live Stream
March Madness 2017
March Madness 2017 Live
ncaa March Madness
ncaa march madness live
ncaa tournament
March Madness Bracket
ncaa final four
NCCAM's continuing interest in acupuncture comes even though many of its studies have found that acupuncture and similar therapies work no better than a sham treatment at easing symptoms like pain and fatigue.
Idaho: Despite the fact that the Tar Pumps displaced within the ACC event semifinals, they had Duke over the rules with regard to a lot of the pioneer 50 percent. Justin Fitzgibbons, with formulated some efficient circumference game, and a foul-free Joel Acai berry II include the first considerations.
ReplyDeleteMarch Madness
March Madness Live
March Madness Live Stream
March Madness 2017
Certainly, we know Indicate Few has never created a last Five. The following group, stocked by means of athletic scorers that can additionally lck lower competitors, are going to be your partner's first
March Madness 2017 Live
ncaa March Madness
ncaa march madness live
ncaa tournament
March Madness Bracket
ncaa final four
Whether you’re even now relating to the containment system this 8-9 sport, and would like some sort of consensus feeling upon your Final Five picks, we’ve became most people dealt with which includes a position of their 68 clubs in the competition. Anyone can with certainty create your choice with some of those mid-major darlings you’ve recently been eyeing for worried likely.
March Madness
March Madness Live
March Madness Live Stream
March Madness 2017
March Madness 2017 Live
ncaa March Madness
ncaa march madness live
ncaa tournament
March Madness Bracket
ncaa final four
Villanova: The superior general seed products. Despite the team’s position inside most challenging region (the East, by means of matchups next to Fight it out in addition to SMU looming), Villanova’s three-man unpleasant center with Jalen Brunson, Josh Hart together with Kris Jenkins gets the possible to repeat when domestic winners.
New Step by Step Map For Watch NBA Basketball Online
ReplyDeleteNBA Live Stream
NBA Live Streaming
NBA Live
ReplyDeleteThe Players Championship 2017
The Players Championship 2017 Live
The Players Championship 2017 Live Stream
Players Championship 2017
Players Championship 2017 Live
Players Championship 2017 Live Stream
2017 Players Championship
2017 Players Championship Live
2017 Players Championship Live Stream
UFC 211
ReplyDeleteUFC 211 Live
UFC 211 Live stream
UFC 211 Live Online
Watch UFC 211
UFC 211 Live Streaming
How to watch UFC 211
UFC 211 Live Free
Miocic vs dos Santos 2
Miocic vs dos Santos 2 Live
Players Championship 2017
Players Championship 2017 Live
Players Championship 2017 Live Stream
Players Championship 2017 Live online
Live stream, Indianapolis 500 Start Time,Indy 500 TV Coverage free,Watch Indy 500 Live stream,indy 500 Car RaceingIndy 500
ReplyDeleteIndy 500 Live stream
Indy 500
Indy 500 Live stream
Indianapolis 500 Start Time
Indy 500 Live Stream Onine
Watch indy 500 live
indy 500 Car Raceing
indy 500 live
indy 500 Car
Mcgregor vs Mayweather
ReplyDeleteMcGregor vs McGregor Live
Mayweather vs mcgregor Live Stream
Mayweathervs mcgregor Live Stream free
Mayweather vs Live Streaming
Mayweather avs McGregor Fight free
Mayweathervs McGregor Stream Fight
Mayweather vs McGregor Boxing Live stream
Mcgregor vs Mayweather PPV Order
Mcgregor vs MayweatherWhare to Watch
Mcgregor vs Mayweather Fight Start Time
Mcgregor vs Mayweather Live Online Tv
ReplyDeleteUFC 218
UFC 218 Live
UFC 218 Live Stream
UFC 218 Live Online
Watch UFC 218
UFC 218 Fight
UFC 218 Fight Card
Holloway vs Aldo 2
Miami vs Clemson
Miami vs Clemson Live
Clemson vs Miami
Wisconsin vs Ohio State
Wisconsin vs Ohio State Live
Ohio State vs Wisconsin
Georgia vs Auburn
Georgia vs Auburn Live
Auburn vs Georgia
TCU vs Oklahoma
TCU vs Oklahoma Live
Oklahoma vs TCU
The Last Jedi
ReplyDeleteThe Last Jedi Movie
The Last Jedi Full Movie
Star Wars The Last Jedi
Star Wars The Last Jedi Movie
Star Wars The Last Jedi
Star Wars The Last Jedi Movie
Star Wars The Last Jedi Full Movie
Watch Star Wars The Last Jedi Movie
Star Wars The Last Jedi Movie Online
Last Jedi
Last Jedi Movie
The Last Jedi
Star Wars The Last Jedi
Golden Globes
ReplyDeleteGolden Globes 2018 live
Golden Globes 2018 live stream
Golden Globes live
Golden Globes live stream
Golden Globe Award
Golden Globes Red Carpet
Golden Globes 2018 time
watch Golden Globes 2018
Golden Globe Award Live
Golden Globe Award 2018
Golden Globes Awards 2018
Golden Globes Awards 2018 Live
75th Golden Globe Awards
75th Golden Globes Awards
2018 Golden Globes
2018 Golden Globes Live
2018 Golden Globe Awards
avengers infinity war watch online 2018
avengers infinity war watch 2018
avengers infinity war watch online in english
avengers infinity war watch online free 2018
avengers infinity war watch full movie 2018
avengers infinity war watch full movie online
avengers infinity war watch order 2018
avengers infinity war watch online 123movies
avengers infinity war watch free
avengers infinity war budget 2018
Listen to ladygaga | SoundCloud is an audio platform that lets you listen to what you love and share the sounds you create..Lady gaga wiki 321 Tracks. 1145579 Followers. Stream Tracks and Playlists from ladygaga on your desktop or mobile device.
ReplyDeleteWatch Annihilation full movie online, Watch Annihilation loading online, Watch Annihilation loading free, Watch Annihilation loading vostfr, Watch Annihilation loading ita, Watch Annihilation loading Watch justice-league (2018) Full Online HD Movie Loading Free Download How exactly to Watch ...
ReplyDeleteAnnihilation watch full movie online
That is the manner by which 76th brilliant Watch golden globes live stream online
ReplyDelete
ReplyDeleteAt the point when are the genuine SAG Awards?
Sag Awards Live
Le Mans 2020 Live Stream Online
ReplyDelete24 Hours Le of Mans 2020 Live Stream Online
Le Mans 2020 Live HD
Le Mans 2020 Stream
Le Mans 2020 Live Start Time
Le Mans 2020 Live
Le Mans 2020 Live STREAMING FREE
Le Mans 2020 Live HD