My layout is:
1 EditText (id = etvalue1)
1 EditText (id = etvalue2)
1 Button (id = save)
I need to know how to do the following with these widgets:
- If the User clicks on the button with the EditText empty display a message and wait for the User to enter the value.
- Display the message until the User and enter the value after the value is to enter the calculation (
etvalue1+etvalue2) and show the result.
In onclicklistener for the button do the following
The maximum time for toast is Toast.LENGTH_LONG. If you want the message to be displayed till the user enters data in edittext, then use a textview to display the message. Set onTextChangedListener on both the EditTexts to check if the text is changed. in afterTextChanged method you can do the calculation.