I\'m building an application for receiving grades and I want to make sure that the Edit Texts are not empty and the values are less or equal to 100 I wrote this line but it
In your xml where you have declared edittext make sure that you put the following attribute in edittext element
android:inputType="number"
And change above code to this :
if(editText.getText().toString().trim().isEmpty() || Integer.parseInt(editText.gettext().toString()) > 100 )
{
//Error message for example
}
you first need to check if text is not empty