title: RadioButton Clear Check Action
body: <p>I have a simple program that has 3 radio buttons in a group. When I click on any of the radio buttons I have a Toast appear to let the user know which button they have selected. </p>
  
  <p>My problem I am facing is I have a <code>onClick</code> event for a button that <code>clearCheck</code> the radio group. When that happens, the Toast message appears again with the previous selected information from the radio button.</p>
  
  <p>How do I prevent the toast from happening when I <code>clearCheck</code> the radio group?</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      RadioGroup radioGroup;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          // Initialize Radio Group and attach click handler
          radioGroup = (RadioGroup) findViewById(R.id.radioGroup);
          radioGroup.clearCheck();
  
          // Attach CheckedChangeListener to Radio Group
          radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
              @Override
              public void onCheckedChanged(RadioGroup group, int checkedId) {
                  RadioButton rb = (RadioButton) group.findViewById(checkedId);
                  if(null!=rb &amp;&amp; checkedId &gt; -1){
                      Toast.makeText(MainActivity.this, rb.getText(), Toast.LENGTH_SHORT).show();
                  }
              }
          });
      }
  
      public void onClear(View v){
          // Clears the radio buttons when the clear button is pressed
          radioGroup.clearCheck();
      }
  </code></pre>