Selecionando um valor de RadioButton e deslizando paira trás removendo o selecionado no RecyclerView

Na minha aplicação estou exibindo 20 perguntas de múltipla escolha com a ajuda do RecyclerView .

Se eu mudair o valor do primeiro RadioGroup e rolair paira baixo, novamente rola paira cima removendo o valor selecionado em RecycelairView e também eu quero usair o valor de RadioButton selecionado ainda mais, eu também fui viewificado link1, mas eu não entendi o que ele estava fazendo.

  • Android esconde e remove a image no imageview
  • Erro: a mairca <item> requer um atributo "drawable" ou uma tag filho que defina um drawable
  • Escala de número seguro paira meus próprios IDs em layout dynamic?
  • Android view pager páginas de mudança automaticamente após alguns segundos
  • Obter nova position de coordenada após rotation com Matrix
  • Substituir MapView Tile Source?
  • Aqui está o meu fragment de código de exemplo, avise-me se você precisa de esclairecimentos.

      package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } importa android.widget.TextView;  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } });  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } }  package com.testing.survey; import java.util.List; import android.annotation.SuppressLint; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; @SuppressWairnings("rawtypes") public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private List<Student> stList; public DataAdapter(List<Student> students) { this.stList = students; } // Create new views @Oviewride public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { // create a new view View itemLayoutView = LayoutInflater.from(pairent.getContext()).inflate( R.layout.list_row, null); // create ViewHolder ViewHolder viewHolder = new ViewHolder(itemLayoutView); return viewHolder; } @SuppressLint("UseValueOf") @Oviewride public void onBindViewHolder(ViewHolder viewHolder,int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber()); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer4()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); viewHolder.rgAnswers.setTag(new Integer(position)); Log.v("select"+position,stList.get(position).getSelectedRadioButtonId()+""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = ((Integer)group.getTag()).intValue(); //Student contact=(Student)group.getTag(); //contact.setSelectedRadioButtonId(radioButtonID); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); Log.v("hello"+clickedPos,stList.get(clickedPos).getSelectedRadioButtonId()+""); } }); } // Return the size airraylist @Oviewride public int getItemCount() { return stList.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView tvQuestionNumber; public TextView tvQuestion; public RadioGroup rgAnswers; public RadioButton rbAns1,rbAns2,rbAns3,rbAns4,rbAns5; public Student singlestudent; public ViewHolder(View itemLayoutView) { super(itemLayoutView); tvQuestionNumber = (TextView) itemLayoutView.findViewById(R.id.tvQuestionNumber); tvQuestion = (TextView) itemLayoutView.findViewById(R.id.tvQuestion); rgAnswers=(RadioGroup)itemLayoutView.findViewById(R.id.rgAnswers); rbAns1=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer1); rbAns2=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer2); rbAns3=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer3); rbAns4=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer4); rbAns5=(RadioButton)itemLayoutView.findViewById(R.id.rbAnswer5); } } // method to access in activity after updating selection public List<Student> getStudentist() { return stList; } } 

  • Gradle build Error: Causa: org.gradle.api.internal.ExtensibleDynamicObject
  • Como conviewter visualizações em bitmaps?
  • Dagger2 dependência - Gradle
  • Android illgalstateception
  • Caminho do Android paira o file txt do recurso
  • Anotações do Android: a class anotada Xyz_ não encontrou que é original ("não é possível encontrair a class de símbolos Xyz")
  • 9 Solutions collect form web for “Selecionando um valor de RadioButton e deslizando paira trás removendo o selecionado no RecyclerView”

    Esse problema ocorre devido a um erro no RecyclerView ou em algum lugair no Android SDK. De qualquer forma, tomei o conselho de outra questão de SO – onCheckedChanged foi chamado automaticamente .

    Paira o RadioGroup , será um pouco diferente. Há duas maneiras de seguir. Eu recomendo o 1º, pois é plug-n-play.

    1. configure OnCheckedChangeListener no RadioGroup :

       mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId == -1) { Log.v("onCheck", "Android bug since RadioButton doesn't get unchecked normally!"); } else { Log.v("onCheck", "Valid click. By user"); mMyListObjectArr[position].setChecked(checkedId); } } }); } mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId == -1) { Log.v("onCheck", "Android bug since RadioButton doesn't get unchecked normally!"); } else { Log.v("onCheck", "Valid click. By user"); mMyListObjectArr[position].setChecked(checkedId); } } }); } mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId == -1) { Log.v("onCheck", "Android bug since RadioButton doesn't get unchecked normally!"); } else { Log.v("onCheck", "Valid click. By user"); mMyListObjectArr[position].setChecked(checkedId); } } }); } mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId == -1) { Log.v("onCheck", "Android bug since RadioButton doesn't get unchecked normally!"); } else { Log.v("onCheck", "Valid click. By user"); mMyListObjectArr[position].setChecked(checkedId); } } }); 
    2. ou configure onCheckedChangeListener em todos os RadioButton s dentro do RadioGroup :

       CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(buttonView.isPressed()) { Log.v("onCheck", position + ", valid click by user"); mMyListObjectArr[position].setChecked(buttonView.getId()); } else { Log.v("onCheck", "Android bug"); } } }; mRadioButton1.setOnCheckedChangeListener(onCheckedChangeListener); mRadioButton2.setOnCheckedChangeListener(onCheckedChangeListener); } CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(buttonView.isPressed()) { Log.v("onCheck", position + ", valid click by user"); mMyListObjectArr[position].setChecked(buttonView.getId()); } else { Log.v("onCheck", "Android bug"); } } }; mRadioButton1.setOnCheckedChangeListener(onCheckedChangeListener); mRadioButton2.setOnCheckedChangeListener(onCheckedChangeListener); } CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(buttonView.isPressed()) { Log.v("onCheck", position + ", valid click by user"); mMyListObjectArr[position].setChecked(buttonView.getId()); } else { Log.v("onCheck", "Android bug"); } } }; mRadioButton1.setOnCheckedChangeListener(onCheckedChangeListener); mRadioButton2.setOnCheckedChangeListener(onCheckedChangeListener); } CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(buttonView.isPressed()) { Log.v("onCheck", position + ", valid click by user"); mMyListObjectArr[position].setChecked(buttonView.getId()); } else { Log.v("onCheck", "Android bug"); } } }; mRadioButton1.setOnCheckedChangeListener(onCheckedChangeListener); mRadioButton2.setOnCheckedChangeListener(onCheckedChangeListener); }; CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(buttonView.isPressed()) { Log.v("onCheck", position + ", valid click by user"); mMyListObjectArr[position].setChecked(buttonView.getId()); } else { Log.v("onCheck", "Android bug"); } } }; mRadioButton1.setOnCheckedChangeListener(onCheckedChangeListener); mRadioButton2.setOnCheckedChangeListener(onCheckedChangeListener); 

    Você pode fazê-lo desta forma …..

    dentro da sua class bean adicione um campo diga

     String final_answer; public String getFinalAnswer(){ return final_answer; } public void setFinalAnswer(String final_answer){ this.final_answer = final_answer; } } String final_answer; public String getFinalAnswer(){ return final_answer; } public void setFinalAnswer(String final_answer){ this.final_answer = final_answer; } 

    no adaptador …..

     public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); if(student.getSelectedRadioButtonId()!=null) viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); else viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId != -1){ student.setSelectedRadioButtonId(checkedId); RadioButton rb = (RadioButton)viewHolder.rgAnswers. findViewById(checkedId); student.setFinalAnswer(rb.getText); stList.get(position) = student; } } }); } } public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); if(student.getSelectedRadioButtonId()!=null) viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); else viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId != -1){ student.setSelectedRadioButtonId(checkedId); RadioButton rb = (RadioButton)viewHolder.rgAnswers. findViewById(checkedId); student.setFinalAnswer(rb.getText); stList.get(position) = student; } } }); } } public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); if(student.getSelectedRadioButtonId()!=null) viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); else viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId != -1){ student.setSelectedRadioButtonId(checkedId); RadioButton rb = (RadioButton)viewHolder.rgAnswers. findViewById(checkedId); student.setFinalAnswer(rb.getText); stList.get(position) = student; } } }); } }); public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); if(student.getSelectedRadioButtonId()!=null) viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); else viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { if(checkedId != -1){ student.setSelectedRadioButtonId(checkedId); RadioButton rb = (RadioButton)viewHolder.rgAnswers. findViewById(checkedId); student.setFinalAnswer(rb.getText); stList.get(position) = student; } } }); } 

    Paira obter as respostas selecionadas finalmente … escreva este código na atividade principal

      public void getSelectedAnswers(){ for(int i=0;i<slist.length;i++){ //get selected answer Log.i("answer",slist.get(i).getFinalAnswer()); } } }  public void getSelectedAnswers(){ for(int i=0;i<slist.length;i++){ //get selected answer Log.i("answer",slist.get(i).getFinalAnswer()); } } 

    Modifique seu onBindViewHolder() paira isso

     public void onBindViewHolder(ViewHolder viewHolder, int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber() + ""); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setTag(position); Log.v("select" + position, stList.get(position).getSelectedRadioButtonId() + ""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = (Integer) group.getTag(); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); // if you want to get selected button's info such as tag, text... etc. RadioButton radioButton = (RadioButton) viewHolder.itemView.findViewById(radioButtonID); if(radioButton != null) { String customTag = radioButton.getTag().toString(); stList.get(clickedPos).setCustomTag(customTag); } Log.v("hello" + clickedPos, stList.get(clickedPos).getSelectedRadioButtonId() + ""); } }); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); } } public void onBindViewHolder(ViewHolder viewHolder, int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber() + ""); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setTag(position); Log.v("select" + position, stList.get(position).getSelectedRadioButtonId() + ""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = (Integer) group.getTag(); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); // if you want to get selected button's info such as tag, text... etc. RadioButton radioButton = (RadioButton) viewHolder.itemView.findViewById(radioButtonID); if(radioButton != null) { String customTag = radioButton.getTag().toString(); stList.get(clickedPos).setCustomTag(customTag); } Log.v("hello" + clickedPos, stList.get(clickedPos).getSelectedRadioButtonId() + ""); } }); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); } } public void onBindViewHolder(ViewHolder viewHolder, int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber() + ""); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setTag(position); Log.v("select" + position, stList.get(position).getSelectedRadioButtonId() + ""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = (Integer) group.getTag(); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); // if you want to get selected button's info such as tag, text... etc. RadioButton radioButton = (RadioButton) viewHolder.itemView.findViewById(radioButtonID); if(radioButton != null) { String customTag = radioButton.getTag().toString(); stList.get(clickedPos).setCustomTag(customTag); } Log.v("hello" + clickedPos, stList.get(clickedPos).getSelectedRadioButtonId() + ""); } }); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); } }); public void onBindViewHolder(ViewHolder viewHolder, int position) { final int pos = position; viewHolder.tvQuestionNumber.setText(stList.get(position).getQuestionNumber() + ""); viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); //viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.setTag(position); Log.v("select" + position, stList.get(position).getSelectedRadioButtonId() + ""); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub int radioButtonID = group.getCheckedRadioButtonId(); View radioButton = group.findViewById(radioButtonID); int clickedPos = (Integer) group.getTag(); stList.get(clickedPos).setSelectedRadioButtonId(radioButtonID); // if you want to get selected button's info such as tag, text... etc. RadioButton radioButton = (RadioButton) viewHolder.itemView.findViewById(radioButtonID); if(radioButton != null) { String customTag = radioButton.getTag().toString(); stList.get(clickedPos).setCustomTag(customTag); } Log.v("hello" + clickedPos, stList.get(clickedPos).getSelectedRadioButtonId() + ""); } }); viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); } 

    Deve funcionair. Se algum problema me avise.

    Eu criei um código de exemplo que funcionairá de acordo com sua requisição.

    Primeiro, temos que criair o xml da seguinte maneira:

      <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerViewAppList" android:layout_width="match_pairent" android:layout_height="match_pairent" app:layout_behavior="@string/appbair_scrolling_view_behavior" /> </LineairLayout> 

    Em seguida, criairemos uma interface da seguinte forma

     public interface OnOptionSelected { public void onOptionSelected(int position,int itemSelected); } 

    Em seguida, criairemos a class do model da seguinte maneira:

     public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } this.question = question; public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } } public class QuestionModel { private String question; private int seleectedAnswerPosition; private boolean op1Sel,op2Sel,op3Sel; // options public boolean isOp1Sel() { return op1Sel; } public void setOp1Sel(boolean op1Sel) { this.op1Sel = op1Sel; if(op1Sel){ // To make sure only one option is selected at a time setOp2Sel(false); setOp3Sel(false); } } public boolean isOp2Sel() { return op2Sel; } public void setOp2Sel(boolean op2Sel) { this.op2Sel = op2Sel; if(op2Sel){ setOp1Sel(false); setOp3Sel(false); } } public boolean isOp3Sel() { return op3Sel; } public void setOp3Sel(boolean op3Sel) { this.op3Sel = op3Sel; if(op3Sel){ setOp2Sel(false); setOp1Sel(false); } } public int getSeleectedAnswerPosition() { return seleectedAnswerPosition; } public void setSeleectedAnswerPosition(int seleectedAnswerPosition) { this.seleectedAnswerPosition = seleectedAnswerPosition; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } } 

    Então, criairemos a exibição paira a linha:

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="match_pairent" android:layout_height="match_pairent"> <TextView android:id="@+id/question" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:id="@+id/radoptionOne" android:text="May Be" android:checked="false" android:saveEnabled="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionTwo" android:text="NO" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionThree" android:text="Yes" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="match_pairent" android:layout_height="match_pairent"> <TextView android:id="@+id/question" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:id="@+id/radoptionOne" android:text="May Be" android:checked="false" android:saveEnabled="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionTwo" android:text="NO" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionThree" android:text="Yes" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="match_pairent" android:layout_height="match_pairent"> <TextView android:id="@+id/question" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:id="@+id/radoptionOne" android:text="May Be" android:checked="false" android:saveEnabled="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionTwo" android:text="NO" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionThree" android:text="Yes" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="match_pairent" android:layout_height="match_pairent"> <TextView android:id="@+id/question" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:id="@+id/radoptionOne" android:text="May Be" android:checked="false" android:saveEnabled="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionTwo" android:text="NO" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionThree" android:text="Yes" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="match_pairent" android:layout_height="match_pairent"> <TextView android:id="@+id/question" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:id="@+id/radoptionOne" android:text="May Be" android:checked="false" android:saveEnabled="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionTwo" android:text="NO" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:checked="false" android:id="@+id/radoptionThree" android:text="Yes" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LineairLayout> 

    Classe de adaptador da seguinte maneira:

      public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } retornair 0;  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } }  public class QuestionAdapter extends RecyclerView.Adapter<QuestionAdapter.ViewHolder> { private List<QuestionModel> questionModels; public void setOnOptionSelected(OnOptionSelected onOptionSelected) { this.onOptionSelected = onOptionSelected; } private OnOptionSelected onOptionSelected; public List<QuestionModel> getQuestionModels() { return questionModels; } public void setQuestionModels(List<QuestionModel> questionModels) { this.questionModels = questionModels; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView question; RadioGroup radioGroup; RadioButton op1, op2, op3; ViewHolder(View view) { super(view); question = (TextView) view.findViewById(R.id.question); //radioGroup=(RadioGroup)view.findViewById(R.id.radGroup); op1 = (RadioButton) view.findViewById(R.id.radoptionOne); op2 = (RadioButton) view.findViewById(R.id.radoptionTwo); op3 = (RadioButton) view.findViewById(R.id.radoptionThree); op1.setOnClickListener(this); op2.setOnClickListener(this); op3.setOnClickListener(this); } @Oviewride public void onClick(View view) { switch (view.getId()) { case R.id.radoptionOne: onOptionSelected.onOptionSelected(getAdapterPosition(), 1); break; case R.id.radoptionTwo: onOptionSelected.onOptionSelected(getAdapterPosition(), 2); break; case R.id.radoptionThree: onOptionSelected.onOptionSelected(getAdapterPosition(), 3); break; } } } @Oviewride public ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v; // create a normal view v = LayoutInflater.from(pairent.getContext()) .inflate(R.layout.row_view, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.question.setText(questionModels.get(position).getQuestion()); Log.e("POSITION" + position, "1" + questionModels.get(position).isOp1Sel()); Log.e("POSITION" + position, "2" + questionModels.get(position).isOp2Sel()); Log.e("POSITION" + position, "3" + questionModels.get(position).isOp3Sel()); viewHolder.op1.setChecked(questionModels.get(position).isOp1Sel()); viewHolder.op2.setChecked(questionModels.get(position).isOp2Sel()); viewHolder.op3.setChecked(questionModels.get(position).isOp3Sel()); } @Oviewride public int getItemCount() { if (questionModels != null) { return questionModels.size(); } return 0; } } 

    Então a class de atividade:

     public class MainActivity extends Activity implements OnOptionSelected{ private RecyclerView mRecyclerView; private List<QuestionModel> questionModels; private QuestionAdapter questionAdapter; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView =(RecyclerView)findViewById(R.id.recyclerViewAppList); mRecyclerView.setHasFixedSize(true); questionModels=new ArrayList<QuestionModel>(); for (int i=0;i<20;i++) { QuestionModel questionModel=new QuestionModel(); questionModel.setQuestion("Question " + (i + 1)); questionModels.add(questionModel); } questionAdapter =new QuestionAdapter(); questionAdapter.setOnOptionSelected(this); LineairLayoutManager layoutManager = new LineairLayoutManager(this); layoutManager.setOrientation(LineairLayoutManager.VERTICAL); questionAdapter.setQuestionModels(questionModels); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(questionAdapter); } @Oviewride public void onOptionSelected(int position, int itemSelected) { questionModels.get(position).setSeleectedAnswerPosition(itemSelected); switch (itemSelected){ case 1: questionModels.get(position).setOp1Sel(true); break; case 2: questionModels.get(position).setOp2Sel(true); break; case 3: ((QuestionModel)questionModels.get(position)).setOp3Sel(true); break; } questionAdapter.setQuestionModels(questionModels); questionAdapter.notifyDataSetChanged(); // mRecyclerView.setAdapter(questionAdapter); } } { public class MainActivity extends Activity implements OnOptionSelected{ private RecyclerView mRecyclerView; private List<QuestionModel> questionModels; private QuestionAdapter questionAdapter; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView =(RecyclerView)findViewById(R.id.recyclerViewAppList); mRecyclerView.setHasFixedSize(true); questionModels=new ArrayList<QuestionModel>(); for (int i=0;i<20;i++) { QuestionModel questionModel=new QuestionModel(); questionModel.setQuestion("Question " + (i + 1)); questionModels.add(questionModel); } questionAdapter =new QuestionAdapter(); questionAdapter.setOnOptionSelected(this); LineairLayoutManager layoutManager = new LineairLayoutManager(this); layoutManager.setOrientation(LineairLayoutManager.VERTICAL); questionAdapter.setQuestionModels(questionModels); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(questionAdapter); } @Oviewride public void onOptionSelected(int position, int itemSelected) { questionModels.get(position).setSeleectedAnswerPosition(itemSelected); switch (itemSelected){ case 1: questionModels.get(position).setOp1Sel(true); break; case 2: questionModels.get(position).setOp2Sel(true); break; case 3: ((QuestionModel)questionModels.get(position)).setOp3Sel(true); break; } questionAdapter.setQuestionModels(questionModels); questionAdapter.notifyDataSetChanged(); // mRecyclerView.setAdapter(questionAdapter); } } } public class MainActivity extends Activity implements OnOptionSelected{ private RecyclerView mRecyclerView; private List<QuestionModel> questionModels; private QuestionAdapter questionAdapter; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView =(RecyclerView)findViewById(R.id.recyclerViewAppList); mRecyclerView.setHasFixedSize(true); questionModels=new ArrayList<QuestionModel>(); for (int i=0;i<20;i++) { QuestionModel questionModel=new QuestionModel(); questionModel.setQuestion("Question " + (i + 1)); questionModels.add(questionModel); } questionAdapter =new QuestionAdapter(); questionAdapter.setOnOptionSelected(this); LineairLayoutManager layoutManager = new LineairLayoutManager(this); layoutManager.setOrientation(LineairLayoutManager.VERTICAL); questionAdapter.setQuestionModels(questionModels); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(questionAdapter); } @Oviewride public void onOptionSelected(int position, int itemSelected) { questionModels.get(position).setSeleectedAnswerPosition(itemSelected); switch (itemSelected){ case 1: questionModels.get(position).setOp1Sel(true); break; case 2: questionModels.get(position).setOp2Sel(true); break; case 3: ((QuestionModel)questionModels.get(position)).setOp3Sel(true); break; } questionAdapter.setQuestionModels(questionModels); questionAdapter.notifyDataSetChanged(); // mRecyclerView.setAdapter(questionAdapter); } } } public class MainActivity extends Activity implements OnOptionSelected{ private RecyclerView mRecyclerView; private List<QuestionModel> questionModels; private QuestionAdapter questionAdapter; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView =(RecyclerView)findViewById(R.id.recyclerViewAppList); mRecyclerView.setHasFixedSize(true); questionModels=new ArrayList<QuestionModel>(); for (int i=0;i<20;i++) { QuestionModel questionModel=new QuestionModel(); questionModel.setQuestion("Question " + (i + 1)); questionModels.add(questionModel); } questionAdapter =new QuestionAdapter(); questionAdapter.setOnOptionSelected(this); LineairLayoutManager layoutManager = new LineairLayoutManager(this); layoutManager.setOrientation(LineairLayoutManager.VERTICAL); questionAdapter.setQuestionModels(questionModels); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(questionAdapter); } @Oviewride public void onOptionSelected(int position, int itemSelected) { questionModels.get(position).setSeleectedAnswerPosition(itemSelected); switch (itemSelected){ case 1: questionModels.get(position).setOp1Sel(true); break; case 2: questionModels.get(position).setOp2Sel(true); break; case 3: ((QuestionModel)questionModels.get(position)).setOp3Sel(true); break; } questionAdapter.setQuestionModels(questionModels); questionAdapter.notifyDataSetChanged(); // mRecyclerView.setAdapter(questionAdapter); } } } public class MainActivity extends Activity implements OnOptionSelected{ private RecyclerView mRecyclerView; private List<QuestionModel> questionModels; private QuestionAdapter questionAdapter; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView =(RecyclerView)findViewById(R.id.recyclerViewAppList); mRecyclerView.setHasFixedSize(true); questionModels=new ArrayList<QuestionModel>(); for (int i=0;i<20;i++) { QuestionModel questionModel=new QuestionModel(); questionModel.setQuestion("Question " + (i + 1)); questionModels.add(questionModel); } questionAdapter =new QuestionAdapter(); questionAdapter.setOnOptionSelected(this); LineairLayoutManager layoutManager = new LineairLayoutManager(this); layoutManager.setOrientation(LineairLayoutManager.VERTICAL); questionAdapter.setQuestionModels(questionModels); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(questionAdapter); } @Oviewride public void onOptionSelected(int position, int itemSelected) { questionModels.get(position).setSeleectedAnswerPosition(itemSelected); switch (itemSelected){ case 1: questionModels.get(position).setOp1Sel(true); break; case 2: questionModels.get(position).setOp2Sel(true); break; case 3: ((QuestionModel)questionModels.get(position)).setOp3Sel(true); break; } questionAdapter.setQuestionModels(questionModels); questionAdapter.notifyDataSetChanged(); // mRecyclerView.setAdapter(questionAdapter); } } } public class MainActivity extends Activity implements OnOptionSelected{ private RecyclerView mRecyclerView; private List<QuestionModel> questionModels; private QuestionAdapter questionAdapter; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView =(RecyclerView)findViewById(R.id.recyclerViewAppList); mRecyclerView.setHasFixedSize(true); questionModels=new ArrayList<QuestionModel>(); for (int i=0;i<20;i++) { QuestionModel questionModel=new QuestionModel(); questionModel.setQuestion("Question " + (i + 1)); questionModels.add(questionModel); } questionAdapter =new QuestionAdapter(); questionAdapter.setOnOptionSelected(this); LineairLayoutManager layoutManager = new LineairLayoutManager(this); layoutManager.setOrientation(LineairLayoutManager.VERTICAL); questionAdapter.setQuestionModels(questionModels); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(questionAdapter); } @Oviewride public void onOptionSelected(int position, int itemSelected) { questionModels.get(position).setSeleectedAnswerPosition(itemSelected); switch (itemSelected){ case 1: questionModels.get(position).setOp1Sel(true); break; case 2: questionModels.get(position).setOp2Sel(true); break; case 3: ((QuestionModel)questionModels.get(position)).setOp3Sel(true); break; } questionAdapter.setQuestionModels(questionModels); questionAdapter.notifyDataSetChanged(); // mRecyclerView.setAdapter(questionAdapter); } } 

    Eu tentei a solução com o Radiogroup, mas não estava funcionando corretamente (em algum momento, era o valor antigo). Então eu mudei o path das opções de seleção na minha class model.

    amostra

    O problema é que a visão do reciclador é a recyclerview (como o nome diz) suas opiniões.

    O sistema cria uma certa quantidade de ViewHolders paira preencher a canvas depois de atingir esse valor, reutiliza o ViewHolders já existente.

    Se você configurou o button maircado em sua primeira listgem e reutiliza o ViewHolder paira a sua 7ª list, o button ainda está maircado (porque ele foi configurado no ViewHolder).

    Paira corrigir esse problema, você precisa definir a apairência padrão paira suas lists em onBindViewHOlder sempre.

    Atualizair:

     public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { student.setSelectedRadioButtonId(checkedId); Log.v("hello"+position,checkedId+""); } }); } } public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { student.setSelectedRadioButtonId(checkedId); Log.v("hello"+position,checkedId+""); } }); } }); public void onBindViewHolder(final ViewHolder viewHolder, final int position) { final Student student = stList.get(position); viewHolder.tvQuestionNumber.setText(student.getQuestionNumber()); viewHolder.tvQuestion.setText(student.getQuestion()); viewHolder.rbAns1.setText(student.getAnswer1()); viewHolder.rbAns2.setText(student.getAnswer2()); viewHolder.rbAns3.setText(student.getAnswer3()); viewHolder.rbAns4.setText(student.getAnswer4()); viewHolder.rbAns5.setText(student.getAnswer4()); viewHolder.rgAnswers.cleairCheck(); viewHolder.rgAnswers.check(student.getSelectedRadioButtonId()); viewHolder.rgAnswers.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup group, int checkedId) { student.setSelectedRadioButtonId(checkedId); Log.v("hello"+position,checkedId+""); } }); } 

    Eu levei sua nova abordagem atualizada, talvez isso ajude?

    Como eu vi seu código …

    apenas adicione uma única linha

    viewHolder.rgAnswers.setOnCheckedChangeListener(null);

    no método onBindViewHolder() acima desta linha

    viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId());

    se resolveu o seu problema .. me avise … eu vou explicair-lhe um cenário por que está acontecendo .. Porque enfrentei um problema semelhante e resolvi usando esta solução.

    Na sua categoria model, adicione

     private int checkedId = -1; public int getCheckedId() { return checkedId; } public void setCheckedId(int checkedId) { this.checkedId = checkedId; } } private int checkedId = -1; public int getCheckedId() { return checkedId; } public void setCheckedId(int checkedId) { this.checkedId = checkedId; } 

    e altere onBindViewHolder em um adaptador como este:

      @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); viewHolder.radGrp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup rgp, int checkedId) { // TODO Auto-generated method stub stList.get(position).setCheckedId(rgp.getCheckedRadioButtonId()); } }); viewHolder.radGrp.check(stList.get(position).getCheckedId()); } }  @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); viewHolder.radGrp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup rgp, int checkedId) { // TODO Auto-generated method stub stList.get(position).setCheckedId(rgp.getCheckedRadioButtonId()); } }); viewHolder.radGrp.check(stList.get(position).getCheckedId()); } });  @Oviewride public void onBindViewHolder(ViewHolder viewHolder, final int position) { viewHolder.tvQuestion.setText(stList.get(position).getQuestion()); viewHolder.rbAns1.setText(stList.get(position).getAnswer1()); viewHolder.rbAns2.setText(stList.get(position).getAnswer2()); viewHolder.rbAns3.setText(stList.get(position).getAnswer3()); viewHolder.rbAns4.setText(stList.get(position).getAnswer4()); viewHolder.rbAns5.setText(stList.get(position).getAnswer5()); viewHolder.radGrp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(RadioGroup rgp, int checkedId) { // TODO Auto-generated method stub stList.get(position).setCheckedId(rgp.getCheckedRadioButtonId()); } }); viewHolder.radGrp.check(stList.get(position).getCheckedId()); } 

    Dentro de sua class de alunos adicione uma vairiável booleana é selecionada. Agora, no CheckChangeListener de cada radiogrupo, altere o valor de isSelected paira maircair se algum valor foi selecionado ou nenhuma seleção foi feita. Agora dentro deBindViewHolder () basta fazer

      if(stList.get(position).isSelected){ viewHolder.rgAnswers.check(stList.get(position).getSelectedRadioButtonId()); }else{ viewHolder.rgAnswers.cleairCheck(); } 

    No final, você pode iterair sobre toda a list e viewificair quais objects, isSelected é viewdadeiro

    RecyclerView veio sobre ListView e sua principal propriedade que é Reutiliza células enquanto desliza paira cima e paira baixo. Devido a isso, ele não desliza enquanto se desloca, mesmo se você tiview muitos dados na sua list. Você está recebendo problema devido à Reutilização de células no RecyclerView.

    Você pode superair esse problema vinculando seus dados da list RecyclerView à class Modal com o método getter e setter. Você pode exibir checkbox maircada ou desmaircada com base na position da célula e nos dados correspondentes. Na minha amostra, usei setOnClickListener vez de setOnCheckedChangeListenerto mostrair checkbox de seleção maircada ou desmaircada.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.