Disable login button till form is filled android sdk -


hello simple question how disable submit button till edittext filled if command or ??

    b = (button)findviewbyid(r.id.login);       et = (edittext)findviewbyid(r.id.username);     pass= (edittext)findviewbyid(r.id.password);      if (et & pass == '  ') {      }      b.setonclicklistener(new onclicklistener() {         @override         public void onclick(view v) {             dialog = progressdialog.show(login.this, "",                      "validating user...", true);              new thread(new runnable() {                     public void run() {                         login();                                               }                   }).start();                        }     }); 

what might want use textwatcher , in ontextchanged() check see if each empty. want check text not view instead of checking et , pass, want string in each.

string etstring = et.gettext().tostring(); string passstring = pass.gettext().tostring(); 

if not emty , null, plus other checks want such length then

b.setenabled(true); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -