Fixed crash due to removed function.

This commit is contained in:
Felix Ableitner 2013-06-27 22:37:18 +02:00
parent 0972b7973b
commit 3e674cd55f
3 changed files with 13 additions and 4 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.nutomic.controldlna" package="com.github.nutomic.controldlna"
android:versionCode="1" android:versionCode="2"
android:versionName="0.1.0" > android:versionName="0.1.1" >
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

View file

@ -28,6 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.github.nutomic.controldlna; package com.github.nutomic.controldlna;
import java.util.Comparator; import java.util.Comparator;
import java.util.List;
import org.teleal.cling.support.model.DIDLObject; import org.teleal.cling.support.model.DIDLObject;
import org.teleal.cling.support.model.container.Container; import org.teleal.cling.support.model.container.Container;
@ -88,4 +89,12 @@ public class FileArrayAdapter extends ArrayAdapter<DIDLObject> {
return convertView; return convertView;
} }
/**
* Replacement for addAll, which is not implemented on lower API levels.
*/
public void add(List<Item> playlist) {
for (DIDLObject d : playlist)
add(d);
}
} }

View file

@ -246,7 +246,7 @@ public class RendererFragment extends Fragment implements
*/ */
public void setPlaylist(List<Item> playlist, int start) { public void setPlaylist(List<Item> playlist, int start) {
mPlaylistAdapter.clear(); mPlaylistAdapter.clear();
mPlaylistAdapter.addAll(playlist); mPlaylistAdapter.add(playlist);
mPlayService.getService().setPlaylist(playlist, start); mPlayService.getService().setPlaylist(playlist, start);
} }
@ -366,7 +366,7 @@ public class RendererFragment extends Fragment implements
mUpnpService.getControlPoint().execute(mSubscriptionCallback); mUpnpService.getControlPoint().execute(mSubscriptionCallback);
} }
mPlaylistAdapter.clear(); mPlaylistAdapter.clear();
mPlaylistAdapter.addAll(mPlayService.getService().getPlaylist()); mPlaylistAdapter.add(mPlayService.getService().getPlaylist());
mListView.setAdapter(mPlaylistAdapter); mListView.setAdapter(mPlaylistAdapter);
} }