Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Created January 6, 2019 19:47
Show Gist options
  • Save salihgueler/bb116717d66d97e4950cdf3b5318dfbc to your computer and use it in GitHub Desktop.
Save salihgueler/bb116717d66d97e4950cdf3b5318dfbc to your computer and use it in GitHub Desktop.
Saturday
/// Method to parse information from the retrieved data
List<Movie> createMovieList(List data) {
List<Movie> list = new List();
for (int i = 0; i < data.length; i++) {
String title = data[i]["title"];
String posterPath = data[i]["poster_path"];
String backdropImage = data[i]["backdrop_path"];
String originalTitle = data[i]["original_title"];
double voteAverage = data[i]["vote_average"];
String overview = data[i]["overview"];
String releaseDate = data[i]["release_date"];
Movie movie = new Movie(
title,
posterPath,
backdropImage,
originalTitle,
voteAverage,
overview,
releaseDate);
list.add(movie);
}
return list;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment