在任务上获得红线。我也导入import com.google.firebase.auth.AuthResult;了,但也显示cannot resolve symbol authresult了这一点。
auth = FirebaseAuth.getInstance();
sign_up_button = (Button) findViewById(R.id.sign_up_button);
email = (EditText) findViewById(R.id.email);
password = (EditText) findViewById(R.id.password);
sign_up_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email_a = email.getText().toString().trim();
String password_a = password.getText().toString().trim();
//create user
auth.createUserWithEmailAndPassword(email_a, password_a)
.addOnCompleteListener(RegisterStaff.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Toast.makeText(RegisterStaff.this, "Registration Complete..:" + task.isSuccessful(), Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
// If sign in fails, display a message to the user. If sign in succeeds
// the …Run Code Online (Sandbox Code Playgroud)