diff --git a/src/com/github/nutomic/controldlna/DeviceArrayAdapter.java b/src/com/github/nutomic/controldlna/DeviceArrayAdapter.java index 94948fb..099eb24 100644 --- a/src/com/github/nutomic/controldlna/DeviceArrayAdapter.java +++ b/src/com/github/nutomic/controldlna/DeviceArrayAdapter.java @@ -153,10 +153,10 @@ public class DeviceArrayAdapter extends ArrayAdapter> } /** - * Not implemented on lower API levels. + * Replacement for addAll, which is not implemented on lower API levels. */ - @Override - public void addAll(Collection> collection) { + @SuppressWarnings("rawtypes") + public void add(Collection collection) { for (Device d : collection) add(d); } diff --git a/src/com/github/nutomic/controldlna/FileArrayAdapter.java b/src/com/github/nutomic/controldlna/FileArrayAdapter.java index b7a434f..b7c3542 100644 --- a/src/com/github/nutomic/controldlna/FileArrayAdapter.java +++ b/src/com/github/nutomic/controldlna/FileArrayAdapter.java @@ -27,7 +27,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.github.nutomic.controldlna; -import java.util.Collection; import java.util.Comparator; import org.teleal.cling.support.model.DIDLObject; @@ -89,13 +88,4 @@ public class FileArrayAdapter extends ArrayAdapter { return convertView; } - /** - * Not implemented on lower API levels. - */ - @Override - public void addAll(Collection collection) { - for (DIDLObject d : collection) - add(d); - } - } diff --git a/src/com/github/nutomic/controldlna/RendererFragment.java b/src/com/github/nutomic/controldlna/RendererFragment.java index ab1b1b7..46bf9b8 100644 --- a/src/com/github/nutomic/controldlna/RendererFragment.java +++ b/src/com/github/nutomic/controldlna/RendererFragment.java @@ -27,7 +27,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.github.nutomic.controldlna; -import java.util.Collection; import java.util.List; import java.util.Map; @@ -139,13 +138,12 @@ public class RendererFragment extends Fragment implements */ private ServiceConnection mUpnpServiceConnection = new ServiceConnection() { - @SuppressWarnings("unchecked") public void onServiceConnected(ComponentName className, IBinder service) { mUpnpService = (AndroidUpnpService) service; Log.i(TAG, "Starting device search"); mUpnpService.getRegistry().addListener(mRendererAdapter); mUpnpService.getControlPoint().search(); - mRendererAdapter.addAll((Collection>) + mRendererAdapter.add( mUpnpService.getControlPoint().getRegistry().getDevices()); } diff --git a/src/com/github/nutomic/controldlna/ServerFragment.java b/src/com/github/nutomic/controldlna/ServerFragment.java index 3bb8f81..0146390 100644 --- a/src/com/github/nutomic/controldlna/ServerFragment.java +++ b/src/com/github/nutomic/controldlna/ServerFragment.java @@ -28,7 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.github.nutomic.controldlna; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Stack; @@ -103,13 +102,12 @@ public class ServerFragment extends ListFragment implements OnBackPressedListene */ private ServiceConnection mUpnpServiceConnection = new ServiceConnection() { - @SuppressWarnings("unchecked") public void onServiceConnected(ComponentName className, IBinder service) { mUpnpService = (AndroidUpnpService) service; Log.i(TAG, "Starting device search"); mUpnpService.getRegistry().addListener(mServerAdapter); mUpnpService.getControlPoint().search(); - mServerAdapter.addAll((Collection>) + mServerAdapter.add( mUpnpService.getControlPoint().getRegistry().getDevices()); }