When I try to run the code below, my program has stops. I want this code to get the value from edittext but it´s not working as I expected it. What am I doing wrong
- Please check the value of EditText, is it a validintegervalue or not.
Try out this code:
int i = 0;
try{
i = Integer.parseInt(from.getText().toString());
}catch(NumberFormatException ex){
System.out.println("Value at TextView is not a valid integer");
}