From c8feea9f37a2502362bcd1fc374a48a7301c6e25 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sun, 10 May 2015 17:05:24 +0200 Subject: [PATCH] Refreshing device list when paired devices change now works. I was using LocalBroadcastManager.... :/ --- .../gadgetbridge/ControlCenter.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java index d3801b16..13f00162 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/ControlCenter.java @@ -96,12 +96,14 @@ public class ControlCenter extends Activity { } }); - IntentFilter filter = new IntentFilter(); - filter.addAction(ACTION_QUIT); - filter.addAction(ACTION_REFRESH_DEVICELIST); - filter.addAction(GBDevice.ACTION_DEVICE_CHANGED); - filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED); - LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filter); + IntentFilter filterLocal = new IntentFilter(); + filterLocal.addAction(ACTION_QUIT); + filterLocal.addAction(ACTION_REFRESH_DEVICELIST); + filterLocal.addAction(GBDevice.ACTION_DEVICE_CHANGED); + filterLocal.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED); + LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filterLocal); + + registerReceiver(mReceiver, new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED)); refreshPairedDevices(); /* @@ -179,6 +181,7 @@ public class ControlCenter extends Activity { @Override protected void onDestroy() { LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver); + unregisterReceiver(mReceiver); super.onDestroy(); }