From 94ed29467de682f9497362538e6b141cbf80f735 Mon Sep 17 00:00:00 2001 From: Doug Keen Date: Wed, 3 Oct 2012 17:36:56 -0700 Subject: [PATCH] Prevent force close in some cases when boarded departure has expired --- .../dougkeen/bart/activities/ViewDeparturesActivity.java | 7 +++++++ .../dougkeen/bart/controls/SwipeDismissTouchListener.java | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java b/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java index 6299364..105c22f 100644 --- a/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java +++ b/src/com/dougkeen/bart/activities/ViewDeparturesActivity.java @@ -591,6 +591,13 @@ public class ViewDeparturesActivity extends SActivity implements final BartRunnerApplication application = (BartRunnerApplication) getApplication(); final Departure boardedDeparture = application .getBoardedDeparture(); + + if (boardedDeparture == null) { + mode.finish(); + refreshBoardedDeparture(); + return true; + } + if (boardedDeparture.isAlarmPending()) { cancelAlarmButton.setVisible(true); setAlarmButton.setIcon(R.drawable.ic_action_alarm); diff --git a/src/com/dougkeen/bart/controls/SwipeDismissTouchListener.java b/src/com/dougkeen/bart/controls/SwipeDismissTouchListener.java index 98e3eda..c82d113 100644 --- a/src/com/dougkeen/bart/controls/SwipeDismissTouchListener.java +++ b/src/com/dougkeen/bart/controls/SwipeDismissTouchListener.java @@ -59,11 +59,6 @@ import static com.nineoldandroids.view.ViewPropertyAnimator.animate; * })); * * - *

- * This class Requires API level 12 or later due to use of - * {@link android.view.ViewPropertyAnimator}. - *

- * * @see SwipeDismissListViewTouchListener */ public class SwipeDismissTouchListener implements View.OnTouchListener {