Possible fix for build error.

This commit is contained in:
Felix Ableitner 2013-06-27 09:20:27 +02:00
parent bb8dfb2b03
commit 0972b7973b
4 changed files with 5 additions and 19 deletions

View file

@ -153,10 +153,10 @@ public class DeviceArrayAdapter extends ArrayAdapter<Device<?, ?, ?>>
}
/**
* Not implemented on lower API levels.
* Replacement for addAll, which is not implemented on lower API levels.
*/
@Override
public void addAll(Collection<? extends Device<?, ?, ?>> collection) {
@SuppressWarnings("rawtypes")
public void add(Collection<Device> collection) {
for (Device<?, ?, ?> d : collection)
add(d);
}

View file

@ -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<DIDLObject> {
return convertView;
}
/**
* Not implemented on lower API levels.
*/
@Override
public void addAll(Collection<? extends DIDLObject> collection) {
for (DIDLObject d : collection)
add(d);
}
}

View file

@ -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<? extends Device<?, ?, ?>>)
mRendererAdapter.add(
mUpnpService.getControlPoint().getRegistry().getDevices());
}

View file

@ -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<? extends Device<?, ?, ?>>)
mServerAdapter.add(
mUpnpService.getControlPoint().getRegistry().getDevices());
}