Guest User

Untitled

a guest
Jun 13th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  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;
Add Comment
Please, Sign In to add comment