1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +01:00

Refreshing device list when paired devices change now works.

I was using LocalBroadcastManager.... :/
This commit is contained in:
Andreas Shimokawa 2015-05-10 17:05:24 +02:00
parent 0d77a5ac05
commit c8feea9f37

View File

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