json - couldn't get data from editText android studio -


i created login form , want check user credentials correct or wrong. before found, not edittext value in string variables. please me store edittext value.

my java code

private string output; private toolbar toolbar; private button button; public edittext username,password; public string myurl,uservalue23,passvalue;  list<datamodel> loginlist;  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_login);      toolbar = (toolbar) findviewbyid(r.id.app_bar);     setsupportactionbar(toolbar);      username = (edittext) findviewbyid(r.id.etusername);     password = (edittext) findviewbyid(r.id.etpassword);      uservalue23 = username.gettext().tostring();     passvalue = password.gettext().tostring();      button = (button) findviewbyid(r.id.btn_login);     button.setonclicklistener(this); } @override public void onclick(view v) {      if(v.getid()==r.id.btn_login)     {         if(inonline())         {             if(uservalue=="")             {                 toast.maketext(this, "tees", toast.length_long).show();             }else{                 toast.maketext(this, uservalue+"tees", toast.length_long).show();             }         }         else         {             toast.maketext(this, "network isn't available", toast.length_long).show();         }     } } 

in xml code created login form 2 edittext form, , these id's respectively etusername, etpassword, btn_login

     if(inonline())             {                 if(uservalue=="")                 {                     toast.maketext(this, "tees", toast.length_long).show();                 }else{ 

**you use value name uservalue didn't define it, define define uservalue23 .. fix , dont need move varibale onclick function **

                    toast.maketext(this, uservalue+"tees", toast.length_long).show();                 }             } 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -