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; }