I have 3 radio button in group and I want to call intent on click of radio button but when I clicked on radio button I got exception and I'm not able to find out what kind of exception I'm getting.
Here is my code.
public class Contentstory extends Activity {
RadioButton Child,Adult,Animated ;
RadioGroup radiogroup1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
radiogroup1 = (RadioGroup) findViewById(R.id.radioGroup1);
final RadioButton Child = (RadioButton)findViewById(R.id.radio0);
radiogroup1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (Child.isChecked()){
Intent intent = new Intent(getApplicationContext(),StoryList.class);
Contentstory.this.startActivity(intent);
}
}
});