diff options
author | campbeb <bpcampbell@gmail.com> | 2012-03-17 11:21:12 +0900 |
---|---|---|
committer | campbeb <bpcampbell@gmail.com> | 2012-03-17 11:21:12 +0900 |
commit | e7df04dc0f6b90c9f258f764a245f04b373579df (patch) | |
tree | 7f2cc923d1b91902fef68477b7c91a50d83e9cc2 /cgeo-calendar | |
parent | 3328115a66148a09874b4a192ae1e759ff5c095d (diff) | |
download | cgeo-e7df04dc0f6b90c9f258f764a245f04b373579df.zip cgeo-e7df04dc0f6b90c9f258f764a245f04b373579df.tar.gz cgeo-e7df04dc0f6b90c9f258f764a245f04b373579df.tar.bz2 |
Finish the activity if exiting on error
Diffstat (limited to 'cgeo-calendar')
-rw-r--r-- | cgeo-calendar/src/cgeo/calendar/CalendarActivity.java | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |