daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class SignUpActivity extends AppCompatActivity {
  2.  
  3. FirebaseAuth mAuth;
  4.  
  5. @Override
  6. protected void onCreate(Bundle savedInstanceState) {
  7.     super.onCreate(savedInstanceState);
  8.     setContentView(R.layout.activity_sign_up);
  9.     mAuth=FirebaseAuth.getInstance();
  10. }
  11.  
  12. public void fgh(View view) {
  13.     mAuth.createUserWithEmailAndPassword("example@email.com","password")
  14.             .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
  15.                 @Override
  16.                 public void onComplete(@NonNull Task<AuthResult> task) {
  17.                     if(task.isSuccessful())
  18.                     {
  19.                         Toast.makeText(SignUpActivity.this, "Successfully created your account", Toast.LENGTH_LONG).show();
  20.                         Intent intent = new Intent(this,SuccessActivity.class);  //this is my error
  21.                         startActivity(intent);  // how to start activity here
  22.                     }
  23.                     else{
  24.                         Toast.makeText(SignUpActivity.this, "ERROR has occurred", Toast.LENGTH_LONG).show();
  25.                     }
  26.                 }
  27.             });
  28. }
  29. }
  30.    
  31. Intent intent = new Intent(SignUpActivity.this,SuccessActivity.class);
  32.    
  33. Intent intent = new Intent(getApplicationContext(), SuccessActivity.class);
  34.    
  35. private Context context;
  36.    
  37. context = this;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top