안드로이드 개발 질문/답변
(글 수 45,052)
package com.edd.dd;
import android.app.Activity; import android.os.Bundle; import android.widget.RadioButton; import android.view.View; import android.view.View.OnClickListener; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.*;
public class EedActivity extends Activity {
/** Called when the activity is first created. */
RadioButton radiocopy;
RadioGroup radiogroup;
Button buttons;
TextView text;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.eeds);
text = (TextView)findViewById(R.id.text1s);
radiogroup = (RadioGroup)findViewById(R.id.rg1);
buttons = (Button)findViewById(R.id.button1);
radiogroup.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(RadioGroup group, int checkedId){
radiocopy = (RadioButton)findViewById(checkedId);
}
});
buttons.setOnClickListener(new OnClickListener(){
public void onClick(View v){
String strch = "";
if(radiocopy != null){
strch = radiocopy.getTag().toString()+(" 성공\n");
}
else{
text.setText("실패");
}
}
});
}
}
radio버튼 한개를 선택 후 완료 버튼을 누르면 radio버튼의 문자를 복사해서 text로 출력하려하는데
에러 없이 실행은 되는데 완료 버튼을 누르는 순간 강제종료가 되네요...
어느 곳이 문제인지 모르겠어서 전문가분들께 물어봅니다...




eeds.xml 도 보여주실 수 있나요?