Check out example codes for "how to make a text field required in android studio". It will help you in understanding the concepts better.

Code Example 1

if(TextUtils.isEmpty(eventEdit.getText()))
{
  eventEdit.setError(" Please Enter Event Name ");
}else {
  //proceed with operation
}

Learn ReactJs, React Native from akashmittal.com