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
|
||||
public void remoteDeviceUpdated(Registry registry, RemoteDevice device) {
|
||||
if (!device.getType().getType().equals(mDeviceType))
|
||||
deviceRemoved(device);
|
||||
deviceAdded(device);
|
||||
mActivity.runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void deviceAdded(final Device<?, ?, ?> device) {
|
||||
|
|
Reference in a new issue