Send dismiss event in main thread

This commit is contained in:
TebbeUbben 2019-02-17 22:02:51 +01:00
parent 8f7a29bd7a
commit 71f73210c9

View file

@ -1537,7 +1537,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
public void onStateChanged(InsightState state) { public void onStateChanged(InsightState state) {
if (state == InsightState.CONNECTED) { if (state == InsightState.CONNECTED) {
statusLoaded = false; statusLoaded = false;
MainApp.bus().post(new EventDismissNotification(Notification.INSIGHT_TIMEOUT_DURING_HANDSHAKE)); new Handler(Looper.getMainLooper()).post(() -> MainApp.bus().post(new EventDismissNotification(Notification.INSIGHT_TIMEOUT_DURING_HANDSHAKE)));
} else if (state == InsightState.NOT_PAIRED) { } else if (state == InsightState.NOT_PAIRED) {
connectionService.withdrawConnectionRequest(this); connectionService.withdrawConnectionRequest(this);
statusLoaded = false; statusLoaded = false;