CodePudding user response:
I want to know how to judge the user name and password are admin and then jump to the welcome page 123456CodePudding user response:
Object the findviewbyid () to obtain the input box, and then get the value judgment, if want to experience the login validation process, can be directly the local write dead judgment, not a post request to the background, or your local build a database used for calibrationCodePudding user response:
The EditText edAccount=the findViewById (R.i d.e d_account);
The EditText edPwd=the findViewById (R.i d.e d_pwd);
//click login button
String account=edAccount. GetText (). The toString (). The trim ();
String PWD=edPwd. GetText (). The toString (). The trim ();
If ((" ademin ".) the equals (account) & amp; & (" 123456 "). The equals (PWD)) {
Toast. MakeText (MainActivity. This, "login succeeds", Toast. LENGTH_SHORT), show ();
} else {
Toast. MakeText (MainActivity. This "user or password password is not correct," Toast. LENGTH_SHORT), show ();
}
CodePudding user response:
Login
Data - bv - feedbackicons - valid="glyphicon glyphicon - ok"
Data - bv - feedbackicons - invalid="glyphicon glyphicon - remove"
Data - bv - feedbackicons - validating="glyphicon glyphicon - refresh" & gt;