Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SignUpActivity extends AppCompatActivity {
- FirebaseAuth mAuth;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_sign_up);
- mAuth=FirebaseAuth.getInstance();
- }
- public void fgh(View view) {
- mAuth.createUserWithEmailAndPassword("example@email.com","password")
- .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
- @Override
- public void onComplete(@NonNull Task<AuthResult> task) {
- if(task.isSuccessful())
- {
- Toast.makeText(SignUpActivity.this, "Successfully created your account", Toast.LENGTH_LONG).show();
- Intent intent = new Intent(this,SuccessActivity.class); //this is my error
- startActivity(intent); // how to start activity here
- }
- else{
- Toast.makeText(SignUpActivity.this, "ERROR has occurred", Toast.LENGTH_LONG).show();
- }
- }
- });
- }
- }
- Intent intent = new Intent(SignUpActivity.this,SuccessActivity.class);
- Intent intent = new Intent(getApplicationContext(), SuccessActivity.class);
- private Context context;
- context = this;
Add Comment
Please, Sign In to add comment