I want to retrieve value from textbox and convert it to integer. I wrote the following code but it throws a NumberFormatException.
String nop = no_of_people.getText().toString();
System.out.println(nop);
int nop1 = Integer.parseInt(nop);
System.out.println(nop1);
The first call to System.out.println prints me the number but converting to integer gives an exception. What am I doing wrong?
trim()there could be spaces around