intent로 checkbox가 체크된 textview를 Mainactivity에서 받아와서 그
textview를 integer형으로 바꾸고, 체크된 textview의 integer값이 존재하면
현재 acticity의 checkbox를 그대로 체크하려는 코드를 짜려는데,
int형으로 다음과 같이 바꾸고.. if문에 조건을 넣었는데 프로그램 실행해서
checkbox를 mainacticity에서 체크하고 버튼을 누르는 순간 현재 activity로
넘어오려는데 바탕화면으로 튕겨버리네요.. 예외처리가 문제인지 어디를 고쳐
야할까요..?
Intent intent = getIntent();
// Integer get_pilaf = intent.getIntExtra("pilaf",0);
String get_pilaf = intent.getStringExtra("pilaf");
String get_bread = intent.getStringExtra("bread");
String get_all = intent.getStringExtra("all");
String get_tomato = intent.getStringExtra("tomato");
String get_cal = intent.getStringExtra("cal");
tv_pilaf.setText(get_pilaf);
tv_bread.setText(get_bread);
tv_all.setText(get_all);
tv_tomato.setText(get_tomato);
tv_total.setText(get_cal);
// int sum = 0;
String a = tv_pilaf.getText().toString();
int a1 = Integer.parseInt(a);
if(a1 > 0) {
checkBox_pilaf.setChecked(true);
// int in = Integer.parseInt(a);
// sum += in;
}