Guest User

Untitled

a guest
Apr 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public void checkEventsInCal() {
  2. ContentResolver cr = getContentResolver();
  3. Cursor cursor = cr.query(Uri.parse("content://com.android.calendar/events"), new String[]{"_id"}, "_id=?", new String[]{CalendarContract.Events.TITLE}, null);
  4.  
  5. if (cursor.moveToFirst()) {
  6. Toast.makeText(this,"Event Exists!", Toast.LENGTH_SHORT).show();
  7. }else {
  8. Toast.makeText(this,"Event Doesn't Exist!", Toast.LENGTH_SHORT).show();
  9. }
  10. }
Add Comment
Please, Sign In to add comment