Fixed device update constantly adding and removing devices.

This commit is contained in:
Felix Ableitner 2013-06-28 09:11:43 +02:00
parent 3ddc533f5b
commit 49614a9051

View file

@ -127,8 +127,15 @@ public class DeviceArrayAdapter extends ArrayAdapter<Device<?, ?, ?>>
@Override
public void remoteDeviceUpdated(Registry registry, RemoteDevice device) {
deviceRemoved(device);
deviceAdded(device);
if (!device.getType().getType().equals(mDeviceType))
deviceRemoved(device);
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
notifyDataSetChanged();
}
});
}
private void deviceAdded(final Device<?, ?, ?> device) {