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() }