diff --git a/src/com/github/nutomic/controldlna/mediarouter/RemotePlayService.java b/src/com/github/nutomic/controldlna/mediarouter/RemotePlayService.java index 676bd99..95770e5 100644 --- a/src/com/github/nutomic/controldlna/mediarouter/RemotePlayService.java +++ b/src/com/github/nutomic/controldlna/mediarouter/RemotePlayService.java @@ -244,4 +244,9 @@ public class RemotePlayService extends Service implements DeviceListenerCallback } } + @Override + public void deviceUpdated(Device device) { + // No need to update as the parameters we need are already known. + } + } diff --git a/src/com/github/nutomic/controldlna/upnp/DeviceListener.java b/src/com/github/nutomic/controldlna/upnp/DeviceListener.java index 131cf8b..179bbeb 100644 --- a/src/com/github/nutomic/controldlna/upnp/DeviceListener.java +++ b/src/com/github/nutomic/controldlna/upnp/DeviceListener.java @@ -56,6 +56,7 @@ public class DeviceListener implements RegistryListener { public interface DeviceListenerCallback { public void deviceAdded(Device device); public void deviceRemoved(Device device); + public void deviceUpdated(Device device); } private ArrayList> mDevices = new ArrayList>(); @@ -127,8 +128,9 @@ public class DeviceListener implements RegistryListener { @Override public void remoteDeviceUpdated(Registry registry, RemoteDevice device) { - deviceRemoved(device); - deviceAdded(device); + for (DeviceListenerCallback l : mListeners) { + l.deviceUpdated(device); + } } } diff --git a/src/com/github/nutomic/controldlna/utility/DeviceArrayAdapter.java b/src/com/github/nutomic/controldlna/utility/DeviceArrayAdapter.java index ec1425d..a717b35 100644 --- a/src/com/github/nutomic/controldlna/utility/DeviceArrayAdapter.java +++ b/src/com/github/nutomic/controldlna/utility/DeviceArrayAdapter.java @@ -132,4 +132,15 @@ public class DeviceArrayAdapter extends ArrayAdapter> } }); } + + @Override + public void deviceUpdated(Device device) { + mActivity.runOnUiThread(new Runnable() { + + @Override + public void run() { + notifyDataSetChanged(); + } + }); + } }