android单选框选择正确的答案

效果图:
android单选框选择正确的答案_第1张图片



    

        

        

        

        
    

    

java代码

public class MainActivity extends Activity {
 
   private RadioGroup rg;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    Button tn = (Button)findViewById(R.id.bt);
    rg = (RadioGroup) findViewById(R.id.radioGroup1);

    tn.setOnClickListener(new OnClickListener() {
    	
    	@Override
    	public void onClick(View arg0) {
    		for(int i=0; i

你可能感兴趣的:(android)