private void OnSignUpClick(object sender, EventArgs e) { if (password.Text != confirmPassword.Text) { new MessageHelper().alertFunction("Error", "Password should be the same", this); return; } Func <string, bool> checkInput = value => value.Trim().Equals("") || value.Length < 0; if (checkInput(username.Text) || checkInput(password.Text) || checkInput(email.Text) || checkInput(phoneNumber.Text) || checkInput(name.Text) || checkInput(age.Text)) { new MessageHelper().alertFunction("Error", "Please Complete all the fields", this); return; } if (userDB.GetUserAsync(username.Text).Result != null) { new MessageHelper().alertFunction("Error", "User name already exit", this); return; } if (userDB.GetUserAsync(email.Text).Result != null) { new MessageHelper().alertFunction("Error", "Email Id already exit", this); return; } var userA = new User { Username = username.Text, Password = password.Text, Name = name.Text, Age = Convert.ToInt32(age.Text), Email = email.Text, MobileNumber = phoneNumber.Text }; if (!userDB.SaveUserAsync(userA).IsCompleted) { new MessageHelper().alertFunction("Registration Successfull", "User created Successfully", this); Intent loginScreeen = new Intent(this, typeof(LoginActivity)); StartActivity(loginScreeen); } else { new MessageHelper().alertFunction("Error", "Something wrong happened", this); } }