Skip to content

Instantly share code, notes, and snippets.

@akndmr
Created March 3, 2018 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akndmr/03b5ffd014598d258e1563ada45e0562 to your computer and use it in GitHub Desktop.
Save akndmr/03b5ffd014598d258e1563ada45e0562 to your computer and use it in GitHub Desktop.
Popvie - Movie Activity
// Fetch a single movie by id
private void fetchMovieByID(int movieId) {
final Call<Movie> call = mService.getMovieWithId(movieId, BuildConfig.TMDB_API_KEY);
call.enqueue(new Callback<Movie>() {
@Override
public void onResponse(Call<Movie> call, Response<Movie> response) {
movie = response.body();
// Do sth with movie instance
// Like : movieTitleTextView.setText(movie.getTitle());
}
@Override
public void onFailure(Call<Movie> call, Throwable t) {
//do sth
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment