0

check my on click code

I use two edit fields and get their texts in on lick method of a button, but when i click button my app crashed. please help me to resolve this problem.

I am fresh one here, if I make any mistake in uploading my question ignore it thanks..!

Andreas
  • 154,647
  • 11
  • 152
  • 247
  • 2
    It would be a lot more helpful to copy and paste the text as text. Speaking only for myself, I don't care if the pretty colors you see in your IDE match the colors we see on here. – Alonso del Arte Oct 31 '20 at 17:56
  • 1
    Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then [edit] your question to include the full source code you have as a [mcve], which can be compiled and tested by others. – Progman Oct 31 '20 at 18:39
  • [Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/q/285551/5221149) – Andreas Oct 31 '20 at 18:45

1 Answers1

0

Text Field returns a string, which can be a non-number string. A try-catch block would help if the method could not parse it into an integer.

Ahmad Khan
  • 757
  • 9
  • 22