Code example for RadioButton

Methods: setCheckedsetEnabledsetText

0
	 
	// Set the values of the display elements 
	private void setValues()	{ 
		qno.setText(""+count_question);
		question.setText(c.getString(c.getColumnIndex("Question")).toString());
		rbn1.setText(c.getString(c.getColumnIndex("Choice1")).toString());
		rbn2.setText(c.getString(c.getColumnIndex("Choice2")).toString());
		rbn3.setText(c.getString(c.getColumnIndex("Choice3")).toString());
		rbn4.setText(c.getString(c.getColumnIndex("Choice4")).toString());
		corrString =(c.getString(c.getColumnIndex("Correct")).toString());
	} 
	 
	// Set a new Question 
	private void setNewQuestion()	{ 
		 
		rbn1.setEnabled(true);
		rbn1.setChecked(false);
		 
		rbn2.setEnabled(true);
		rbn2.setChecked(false);
		 
		rbn3.setEnabled(true);
Stop searching for code, let great code find you!  Add Codota to your java IDE