In android, onCheckedChanged of a Radiogroup is not triggered when I Programmatically set a Radiobutton by call setChecked(true)
<p>In my application, I need to programmatically set a radiobutton and expect the onCheckedChanged of a Radiogroup to be triggered so that I can do something in it.</p>

<p>Code to programmatically set a radiobutton.</p>

<pre><code> LayoutInflater inflater = LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
 View view = inflater.inflate(R.layout.footer, null);`
 RadioButton btn = (RadioButton)view.findViewById(R.id.footer_btn_course);
 btn.setChecked(true);
</code></pre>

<p>And in another activity, I did something like:</p>

<pre><code> public class MainActivity extends ActivityGroup implements RadioGroup.OnCheckedChangeListener{
      protected void onCreate(Bundle savedInstanceState){
            mRadioGroup = (RadioGroup)findViewById(R.id.footer_radio);
            mRadioGroup.setOnCheckedChangeListener(this);
      }

      @Override
      public void onCheckedChanged(RadioGroup group, int checkedId){
            RadioButton btn = (RadioButton)findViewById(checkedId);
            if(btn != null){
                  do_something();
            }
      }
  }
</code></pre>

<p>However, looks like this way doesn't work, the onCheckedChanged was never called. Anyone know what I should do? Thanks.</p>
