From 4ea5f2e226a5bcb99bc1a886cfbfee059e946680 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Fri, 10 Aug 2018 22:20:38 +0200 Subject: [PATCH] Fix #279 Signed-off-by: Mario Danic --- .../talk/controllers/CallNotificationController.java | 12 ++++++++---- .../utils/singletons/ApplicationWideApiHolder.java | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java index b8b5d0b68..edcab8a98 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java @@ -299,10 +299,14 @@ public class CallNotificationController extends BaseController { renderScript = RenderScript.create(getActivity()); - try { - cache.evictAll(); - } catch (IOException e) { - Log.e(TAG, "Failed to evict cache"); + if (handler == null) { + handler = new Handler(); + + try { + cache.evictAll(); + } catch (IOException e) { + Log.e(TAG, "Failed to evict cache"); + } } if (currentConversation == null) { diff --git a/app/src/main/java/com/nextcloud/talk/utils/singletons/ApplicationWideApiHolder.java b/app/src/main/java/com/nextcloud/talk/utils/singletons/ApplicationWideApiHolder.java index e3f62577c..c65991879 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/singletons/ApplicationWideApiHolder.java +++ b/app/src/main/java/com/nextcloud/talk/utils/singletons/ApplicationWideApiHolder.java @@ -38,8 +38,8 @@ import autodagger.AutoInjector; import retrofit2.Retrofit; @AutoInjector(NextcloudTalkApplication.class) -public class ApiHolder { - private static final String TAG = "ApiHolder"; +public class ApplicationWideApiHolder { + private static final String TAG = "ApplicationWideApiHolder"; @SuppressLint("UseSparseArrays") private Map ncApiHashMap; @@ -50,9 +50,9 @@ public class ApiHolder { @Inject Retrofit retrofit; - private static final ApiHolder holder = new ApiHolder(); + private static final ApplicationWideApiHolder holder = new ApplicationWideApiHolder(); - public static ApiHolder getInstance() { + public static ApplicationWideApiHolder getInstance() { return holder; }