ラジオグループを編集テキストに追加

radiogroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener(){


@オーバーライド
public void onCheckedChanged(RadioGroup group、int checkedId){
// TODO自動生成されたメソッドスタブ

//選択したアイテムのIDを取得します
int radioButtonId = group.getCheckedRadioButtonId();
// IDに基づいてRadioButtonのインスタンスを取得します
RadioButton rb =(RadioButton)SecondActivity.this
.findViewById(radioButtonId);
//選択したアイテムに一致するようにテキストコンテンツを更新します
idText1.setText( "学習するコースは次のとおりです。" + rb.getText());

}
});
元の18件の記事を公開 賞賛4件 40,000回以上の閲覧

おすすめ

転載: blog.csdn.net/caoming51021/article/details/44411939