Get integer value from edittext

前端 未结 3 379

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

3条回答
  •  庸人自扰
    2021-01-25 00:42

    as you can see from your Logcat:

    08-28 19:34:44.790: E/AndroidRuntime(3346): Caused by: java.lang.NumberFormatException: Invalid int: ""

    there was an empty input that couldn't be converted into an int.

    try validating user input.

提交回复
热议问题