I have created a business upload form using android studio linked to firebase database, I am facing an issue where i could only add a constraint on the (name=empty display "please fill all fields"), but how can i add this to every other EditText field, so when the user does not fill them all the message shows. here is the code
private void addBusiness(){
String name = businame.getText().toString().trim();
String email = busiemail.getText().toString().trim();
String number = businum.getText().toString().trim();
String address = busiadd.getText().toString().trim();
String info = busiinfo.getText().toString().trim();
String type = spinnerType.getSelectedItem().toString();
if (!TextUtils.isEmpty(name)) {
String id= databaseBusiness.push().getKey();
Business business = new Business(id, name, email, number, address, info, type);
databaseBusiness.child(id).setValue(business);
Toast.makeText(this,"Upload Done", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this,"Please Fill All Fields",Toast.LENGTH_LONG).show();
}
}