Thursday, April 11, 2013

[android help] How to hold the selected value in the radio button?

android - How to hold the selected value in the radio button? - Stack Overflow



















I'M doing quiz app. I have set 50 questions and each question contains 4 options(radio group) with pervious and next button. What i need is when select the answer and goes for next question and again he comes to previous question that time what he select perviously that answer should be in selected state. But user selected value i getText() How to implement this ? Any one help me..


Thanks in advance..




ImageView previousbtn1 = (ImageView) findViewById(R.id.prv_btn);
previousbtn1.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v){
if (j < 1) {
Toast.makeText(Question.this, "First Question",Toast.LENGTH_SHORT).show();
} else {
--j;
--num;
--m;
TextView txtque = (TextView) findViewById(R.id.que_txt);
txtque.setText("Q" + num + ")" + ques1.get(j));
--k;
btn_practice1.setText(answ1.get((k*4)+0));
btn_practice2.setText(answ1.get((k*4)+1));
btn_practice3.setText(answ1.get((k*4)+2));
btn_practice4.setText(answ1.get((k*4)+3));
}
}
});
















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










default






.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...