// TODO Here I define the order for which I want the videos to play.
// Could try diferent ordering for the playlists
// For now it just accepts the gridAdapter selected array order
public void saveNewPlayList(String name) {
        Playlist pl = new Playlist();
        pl.setName(name);
        pl.save();
        List<String> selectedVideos = videoGridAdapter.getCheckedItems();
        List<Video> myVideos = new ArrayList<>();
        // TODO Here I define the order for which I want the videos to play.
        // Could try diferent ordering for the playlists
        // For now it just accepts the gridAdapter selected array order
        int order = 0;
        for (String vid : selectedVideos) {
            Video video = new Video();
            video.setUri(vid);
            video.setPlaylist(pl);
            video.setOrder(order);
            order++;
            myVideos.add(video);
        }
        Video.saveAll(myVideos);
        updatePlaylistList();
        cancelCreatePlaylist();
    }
List<String> selectedVideos = videoGridAdapter.getCheckedItems();
List<Video> myVideos = new ArrayList<>();
// TODO Here I define the order for which I want the videos to play.
// Could try diferent ordering for the playlists
// For now it just accepts the gridAdapter selected array order
int order = 0;
for (String vid : selectedVideos) {
public void saveNewPlayList(String name) {
Playlist pl = new Playlist();
pl.setName(name);
pl.save();
List<String> selectedVideos = videoGridAdapter.getCheckedItems();
List<Video> myVideos = new ArrayList<>();
// TODO Here I define the order for which I want the videos to play.
// Could try diferent ordering for the playlists
// For now it just accepts the gridAdapter selected array order
int order = 0;
for (String vid : selectedVideos) {
Video video = new Video();
video.setUri(vid);
video.setPlaylist(pl);
video.setOrder(order);
order++;
myVideos.add(video);
}
Video.saveAll(myVideos);
public void saveNewPlayList(String name) {
Playlist pl = new Playlist();
pl.setName(name);
pl.save();
List<String> selectedVideos = videoGridAdapter.getCheckedItems();
List<Video> myVideos = new ArrayList<>();
// TODO Here I define the order for which I want the videos to play.
// Could try diferent ordering for the playlists
// For now it just accepts the gridAdapter selected array order
int order = 0;
for (String vid : selectedVideos) {
Video video = new Video();
video.setUri(vid);
video.setPlaylist(pl);
video.setOrder(order);
order++;
myVideos.add(video);
}
Video.saveAll(myVideos);
updatePlaylistList();
cancelCreatePlaylist();
}