🐛 Prevent ANR
This commit is contained in:
parent
0b432b6a67
commit
9cc07f73ae
@ -28,6 +28,7 @@ import ch.dissem.apps.abit.notification.NetworkNotification.Companion.NETWORK_NO
|
|||||||
import ch.dissem.apps.abit.util.Preferences
|
import ch.dissem.apps.abit.util.Preferences
|
||||||
import ch.dissem.bitmessage.BitmessageContext
|
import ch.dissem.bitmessage.BitmessageContext
|
||||||
import ch.dissem.bitmessage.utils.Property
|
import ch.dissem.bitmessage.utils.Property
|
||||||
|
import org.jetbrains.anko.doAsync
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a Service that returns an IBinder for the
|
* Define a Service that returns an IBinder for the
|
||||||
@ -87,7 +88,9 @@ class BitmessageService : Service() {
|
|||||||
running = false
|
running = false
|
||||||
notification.showShutdown()
|
notification.showShutdown()
|
||||||
cleanupHandler.removeCallbacks(cleanupTask)
|
cleanupHandler.removeCallbacks(cleanupTask)
|
||||||
bmc.cleanup()
|
doAsync {
|
||||||
|
bmc.cleanup()
|
||||||
|
}
|
||||||
unregisterReceiver(connectivityReceiver)
|
unregisterReceiver(connectivityReceiver)
|
||||||
stopSelf()
|
stopSelf()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user