Android Validators fields -


i have made many layout in android. kindly tell me best , easy way validate input field before save data database. required field. data should in number etc.

for input must number use @ edittext

android:inputtype="number" 

for required field can use :

 private boolean isempty(edittext edittext) {         boolean isempty = false;         if (textutils.isempty(edittext.gettext())) {             isempty = true;             edittext.seterror("empty field");         }          return isempty     } 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -