From e7df04dc0f6b90c9f258f764a245f04b373579df Mon Sep 17 00:00:00 2001 From: campbeb Date: Sat, 17 Mar 2012 11:21:12 +0900 Subject: Finish the activity if exiting on error --- cgeo-calendar/src/cgeo/calendar/CalendarActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cgeo-calendar') diff --git a/cgeo-calendar/src/cgeo/calendar/CalendarActivity.java b/cgeo-calendar/src/cgeo/calendar/CalendarActivity.java index b339954..226b486 100644 --- a/cgeo-calendar/src/cgeo/calendar/CalendarActivity.java +++ b/cgeo-calendar/src/cgeo/calendar/CalendarActivity.java @@ -85,11 +85,11 @@ public final class CalendarActivity extends Activity { final String[] projection = new String[] { "_id", "displayName" }; final Uri calendarProvider = Compatibility.getCalendarProviderURI(); - // TODO: Handle missing provider final Cursor cursor = managedQuery(calendarProvider, projection, "selected=1", null, null); if (cursor == null || cursor.getCount() <= 0) { showToast(getResources().getString(R.string.event_fail)); + finish(); return; } @@ -116,6 +116,8 @@ public final class CalendarActivity extends Activity { } while (cursor.moveToNext()); if (calendars.isEmpty()) { + showToast(getResources().getString(R.string.event_fail)); + finish(); return; } -- cgit v1.1