Created
March 3, 2018 23:51
-
-
Save akndmr/03b5ffd014598d258e1563ada45e0562 to your computer and use it in GitHub Desktop.
Popvie - Movie Activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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