private List<Question> mQuestionList = new ArrayList<>(); @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View questionView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.question_item, parent, false); return new QuestionViewHolder(questionView); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { ((QuestionViewHolder) holder).bindView(mQuestionList.get(position)); } public void setQuestionList(List<Question> questionList) { mQuestionList = questionList; notifyDataSetChanged(); } @Override public int getItemCount() { return mQuestionList.size(); } }