From 5c143098a481a1877975cbc74308d1c68ca9c37a Mon Sep 17 00:00:00 2001 From: Mykhailo Shchurov Date: Sun, 28 Jun 2015 11:03:03 +0300 Subject: [PATCH] QuizActivity. Fixed multiple back-presses crash. --- .../com/google/samples/apps/topeka/activity/QuizActivity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/google/samples/apps/topeka/activity/QuizActivity.java b/app/src/main/java/com/google/samples/apps/topeka/activity/QuizActivity.java index 2005c009..8026f5f2 100644 --- a/app/src/main/java/com/google/samples/apps/topeka/activity/QuizActivity.java +++ b/app/src/main/java/com/google/samples/apps/topeka/activity/QuizActivity.java @@ -132,6 +132,9 @@ public void onBackPressed() { new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { + if (isFinishing() || isDestroyed()) { + return; + } QuizActivity.super.onBackPressed(); super.onAnimationEnd(animation); }