Fixed device update constantly adding and removing devices.
This commit is contained in:
parent
3ddc533f5b
commit
49614a9051
1 changed files with 9 additions and 2 deletions
|
@ -127,8 +127,15 @@ public class DeviceArrayAdapter extends ArrayAdapter<Device<?, ?, ?>>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remoteDeviceUpdated(Registry registry, RemoteDevice device) {
|
public void remoteDeviceUpdated(Registry registry, RemoteDevice device) {
|
||||||
deviceRemoved(device);
|
if (!device.getType().getType().equals(mDeviceType))
|
||||||
deviceAdded(device);
|
deviceRemoved(device);
|
||||||
|
mActivity.runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deviceAdded(final Device<?, ?, ?> device) {
|
private void deviceAdded(final Device<?, ?, ?> device) {
|
||||||
|
|
Reference in a new issue