EditText et_value1=(EditText)findViewById(R.id.edit_value1);
String str_value1=et_value1.getText().toString();
it3.putExtra( "it3_value1" , str_value1);
|
이렇게 데이터를 입력 받거든요. 받는데서는
String str_value1=it3.getStringExtra( "it3_value1" );
TextView txt_value1=(TextView)findViewById(R.id.edit_value1);
int temp1=Integer.parseInt(str_value1);
TextView txt_value1=(TextView)findViewById(R.id.edit_value1);
if ( ( 99 < temp1 )&& (temp1 < 111 ) ) {
txt_value1.setText(str_value1);
|
이렇게 받는데 제가 숫자를 받느 라고 Integer.parseInt 이걸 쓰고 있습니다. 그런데 아무것도 입력안하고 넘기면 로그캣에 unable to parse ' ' as integer 라고 뜨거든요. 이게 공백을 숫자로 변환하려고 해서 그렇다는데 그래서
if무느로
String str_value1=it3.getStringExtra( "it3_value1" );
if (str_value1 == null ){
TextView txt_value1=(TextView)findViewById(R.id.edit_value1);
txt_value1.setText(str_value1);
} else {
int temp1=Integer.parseInt(str_value1);
TextView txt_value1=(TextView)findViewById(R.id.edit_value1);
if ( ( 99 < temp1 )&& (temp1 < 111 ) ) {
txt_value1.setText(str_value1);
|
이런식으로 해줬거든요. txt_value1.setText(str_value1); 이거는 공백도 그냥 아무것도 없이 출력을 해주더라구요.
이렇게 했는데도 로그캣에 unable to parse ' ' as integer 라고 뜹니다..
어떻게 해줘야 하나요?