0

I have a problem with basic4anfroid.

I have two EditText fields and a button that performs mathematical operations. Everything works but I would need to reset the values ​​of the two EditTexts with a "Reset" button. Click event on the reset button, the code edittext1.text = 0 does nothing.

CRUSADER
  • 5,486
  • 3
  • 28
  • 64
GLuca D
  • 1
  • 1

2 Answers2

3

You should set it to an empty string:

EditText1.Text = ""
Erel
  • 1,802
  • 2
  • 15
  • 58
1

Edittext1.text is looking for a string not an integer. 0 is an integer. If you want the number 0 to be in the Edittext field, then you would use the following code:

edittext1.text = "0"

Notice the quotation marks around the 0, this makes it a string not an integer. Also if someone answered your question, please mark it as accepted.