テキストボックスから値を取得して整数に変換したい。次のコードを書きましたが、NumberFormatException
.
String nop = no_of_people.getText().toString();
System.out.println(nop);
int nop1 = Integer.parseInt(nop);
System.out.println(nop1);
への最初の呼び出しSystem.out.println
で数値が出力されますが、整数に変換すると例外が発生します。私は何を間違っていますか?