From 9cc07f73ae492480e6b93119db404883df23c88d Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Thu, 24 May 2018 21:08:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Prevent=20ANR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ch/dissem/apps/abit/service/BitmessageService.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt b/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt index 2ce3b3f..523e832 100644 --- a/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt +++ b/app/src/main/java/ch/dissem/apps/abit/service/BitmessageService.kt @@ -28,6 +28,7 @@ import ch.dissem.apps.abit.notification.NetworkNotification.Companion.NETWORK_NO import ch.dissem.apps.abit.util.Preferences import ch.dissem.bitmessage.BitmessageContext import ch.dissem.bitmessage.utils.Property +import org.jetbrains.anko.doAsync /** * Define a Service that returns an IBinder for the @@ -87,7 +88,9 @@ class BitmessageService : Service() { running = false notification.showShutdown() cleanupHandler.removeCallbacks(cleanupTask) - bmc.cleanup() + doAsync { + bmc.cleanup() + } unregisterReceiver(connectivityReceiver) stopSelf() }