Problem while using recyclerview with cardview
What I want to do is this: I have a quiz application containing recyclerview which contains several cardviews.
Each cardview itself holds one question and 4 options to choose. These four options are in form of radiobuttons among which there is one correct answer. There are 16-17 such cardviews containing question and options. Now, after useranswers all these questions., I have a submit button at the end of recyclerview. When user clicks on submit, the score scored by user gets displayed to him.There are two problems,
- How to keep track of which radiobutton has been clicked by user in every cardview.
- When I click on on radiobutton in a cardview, because of recycle property of recyclerview, the radiobutton get selected randomly on scroll.
I am unable to solve both the problems mentioned above. Also, my questions are in json file which I am loading using Volley Library. Please help me. Below are few screenshots attached of my app:
even im facing the second issue..but for the first issue use string builder to store the radio buttons value and pass the variable on submit button..hope it will work…check the below code
StringBuilder Qualification=new StringBuilder();
Toast.makeText(SecondActivity.this, "Please select the Qualification", Toast.LENGTH_SHORT).show();