我在验证方面遇到了一些问题。如何更改我的编码,以便一次一个验证。我正在看很多教程,这里是结果。我希望我的验证一一来。那么应该如何呢?提前致谢。
private void RegisterAccount(String firstname, String lastname, String email, String password, String confirmpass)
{
if (TextUtils.isEmpty(firstname))
{
Toast.makeText(Signup.this, "Enter your first name.", Toast.LENGTH_LONG).show();
}
if (TextUtils.isEmpty(lastname))
{
Toast.makeText(Signup.this, "Enter your last name.", Toast.LENGTH_LONG).show();
}
if (TextUtils.isEmpty(email))
{
Toast.makeText(Signup.this, "Enter your valid email address.", Toast.LENGTH_LONG).show();
}
if (TextUtils.isEmpty(password))
{
Toast.makeText(Signup.this, "Enter your password.", Toast.LENGTH_LONG).show();
}
if (TextUtils.isEmpty(confirmpass)) {
Toast.makeText(Signup.this, "Please write your password again.", Toast.LENGTH_LONG).show();
}
if (password != confirmpass)
{
Toast.makeText(Signup.this, "Password do not match", Toast.LENGTH_LONG).show();
}
慕桂英4014372
相关分类