Code example for RadioButton

Methods: getText, isChecked

0
			public void onClick(View v) {
				String sSearch = txtSearch.getText().toString();
				if (rbtnMovie.isChecked()){
					longToast(rbtnMovie.getText() + " " + sSearch);
				} 
				else if (rbtnPeople.isChecked()){
					longToast(rbtnPeople.getText() + " " + sSearch);
				} 
			}        	 
        }); 
        txtSearch.setOnFocusChangeListener(new DftTextOnFocusListener(this.getString(R.string.search)));
        int iID = rbtnGroup.getCheckedRadioButtonId();
        RadioButton rbtn = (RadioButton)findViewById(iID);
        lblSearchType.setText(rbtn.getText().toString());
   } 
     
    private void findAllViewsById(){ 
        txtSearch = (EditText)findViewById(R.id.txtSearch);
        rbtnMovie = (RadioButton)findViewById(R.id.rbtnMovie);
        rbtnPeople = (RadioButton)findViewById(R.id.rbtnPeople);
        rbtnGroup = (RadioGroup)findViewById(R.id.search_radio_group);