Skip to content
Advertisement

Android : Convert CharSequence to Int in Java

I’m confused on how can I convert CharSequence to int , I just want to set visibility of textfield when the inputted amount of edt_nma_amount is >=100

What I tried to convert it

JavaScript

but it returns me an error It crashes my app because the number is like string “”

JavaScript

java

JavaScript

Updated

I have this data

JavaScript

but it returns me an error AT int numbers=Integer.valueOf(amt); I think it is NumberFormatException

enter image description here

Advertisement

Answer

Please change the code inside onTextChanged call back

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement