From 4cc8595e84fce7012a1836d06a5e3d5b18c07769 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 1 Mar 2017 23:21:05 +1300 Subject: Check activity in callback --- app/src/main/java/org/traccar/manager/StartFragment.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/org/traccar/manager/StartFragment.java b/app/src/main/java/org/traccar/manager/StartFragment.java index f56d7e8..c88c260 100644 --- a/app/src/main/java/org/traccar/manager/StartFragment.java +++ b/app/src/main/java/org/traccar/manager/StartFragment.java @@ -87,10 +87,12 @@ public class StartFragment extends Fragment implements View.OnClickListener { @Override protected void onPostExecute(Boolean result) { - if (result) { - onSuccess(); - } else { - onError(); + if (getActivity() != null) { + if (result) { + onSuccess(); + } else { + onError(); + } } } -- cgit v1.2.3