return when activity is finishing

This commit is contained in:
ligi 2014-09-28 15:39:01 +02:00
parent cf43c500fb
commit c5c6bcb8da

View file

@ -48,7 +48,11 @@ public class UnzipPassDialog {
@Override
public void call(final String pathToPassbook) {
if (!activity.isFinishing() && dialog.isShowing()) {
if (activity.isFinishing()) {
return;
}
if (dialog.isShowing()) {
dialog.dismiss();
}
activity.runOnUiThread(new Runnable() {
@ -66,7 +70,10 @@ public class UnzipPassDialog {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (!activity.isFinishing() && dialog.isShowing()) {
if (activity.isFinishing()) {
return;
}
if (dialog.isShowing()) {
dialog.dismiss();
}
DisplayError(activity, activity.getString(R.string.invalid_passbook_title), reason);