From e6538bc9caa2bf254dfcd0bad4cae871f97750e3 Mon Sep 17 00:00:00 2001 From: Javier Santos Date: Sun, 19 Mar 2017 11:38:22 +0100 Subject: [PATCH] Fix issue when activity is finished --- .../com/github/javiersantos/piracychecker/PiracyChecker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/src/main/java/com/github/javiersantos/piracychecker/PiracyChecker.java b/library/src/main/java/com/github/javiersantos/piracychecker/PiracyChecker.java index ceb0788..69c8ace 100644 --- a/library/src/main/java/com/github/javiersantos/piracychecker/PiracyChecker.java +++ b/library/src/main/java/com/github/javiersantos/piracychecker/PiracyChecker.java @@ -209,6 +209,10 @@ public void allow() { @Override public void dontAllow(@NonNull PiracyCheckerError error, @Nullable PirateApp app) { + if (context instanceof Activity && ((Activity) context).isFinishing()) { + return; + } + String dialogContent = unlicensedDialogDescription; if (app != null) dialogContent = context.getString(R.string.unauthorized_app_found, app.getName());