java.lang.NumberFormatException: Invalid int: “” : Error

前端 未结 5 1986
南笙
南笙 2021-01-21 08:22

I am doing some calculation but unable to parse a string into int or even in float.I searched for solution and i read it somewhere there must be a empty string but i checked my

5条回答
  •  悲哀的现实
    2021-01-21 09:18

    There's no value yet when onCreate() runs. Move the getText() and parseInt() inside your click listener to read and parse the value when you have entered something.

提交回复
热议问题