コード例 #1
0
 @OnClick(R.id.mark_favorite)
 protected void onClickFavorite() {
   Snackbar.make(mView, "Item favorited", Snackbar.LENGTH_SHORT).show();
   ContentValues contentValues = new ContentValues();
   contentValues.put(MoviesContract.MovieEntry.COLUMN_MOVIE_ID, mMovie.getId());
   contentValues.put(MoviesContract.MovieEntry.COLUMN_TITLE, mMovie.getTitle());
   contentValues.put(MoviesContract.MovieEntry.COLUMN_POSTER_PATH, mMovie.getPosterPath());
   contentValues.put(MoviesContract.MovieEntry.COLUMN_RELEASE_DATE, mMovie.getReleaseDate());
   contentValues.put(MoviesContract.MovieEntry.COLUMN_VOTE_AVERAGE, mMovie.getmVoteAverage());
   getActivity().getContentResolver().insert(MoviesContract.MovieEntry.CONTENT_URI, contentValues);
 }
コード例 #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (getArguments() != null) {
      mMovie = getArguments().getParcelable(PARAMS_MOVIE);
      if (mMovie != null) {
        mId = mMovie.getId();
      }
      mDetailedPresenterImp = new DetailedPresenterImp(this, mId);

      mTrailers = new ArrayList<>();
      mReviews = new ArrayList<>();
    }
  }