From 82b246bee7d751885b4bbbdd952a50be62622465 Mon Sep 17 00:00:00 2001 From: Pietro Rampini Date: Tue, 19 Nov 2013 22:51:53 +0100 Subject: [PATCH] Fix #27, Try #1 --- library/src/com/rampo/updatechecker/UpdateChecker.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/src/com/rampo/updatechecker/UpdateChecker.java b/library/src/com/rampo/updatechecker/UpdateChecker.java index ff426d9..91a3fa3 100644 --- a/library/src/com/rampo/updatechecker/UpdateChecker.java +++ b/library/src/com/rampo/updatechecker/UpdateChecker.java @@ -299,10 +299,10 @@ public void showDialog(String versionDownloadable) { try { dialog.show(getActivity().getSupportFragmentManager(), null); } catch (NullPointerException activityClosed) { - /* This happens when the library tries to open a dialog, - but the activity is already closed, so generates a NullPointerException. - In this way, a force close is avoided.*/ - } + } catch (IllegalStateException activityClosed) { + } /* Catch blocks happens when the library tries to open a dialog, + but the activity is already closed, so generates a NullPointerException or IllegalStateException. + In this way, a force close is avoided.*/ } /**