[Solved] Android: Why can’t I move to another Acivity by using “Intent”?


When you call the method “createNewUser()”, you are inside of an onClickListener. When you pass in ‘this’ as your context, you are passing in the context of your listener. Instead, when calling createNewUser, use ‘MainActivity.this’ as your Context, so then your app knows that the context is the whole activity and not just the listener. That means the code should be

}else {

    firebaseApplication = new FirebaseApplication();
    firebaseApplication.createNewUser(MainActivity.this, email, password);
    ShortCut.displayMessageToast(this, "just for a debug");
}

3

solved Android: Why can’t I move to another Acivity by using “Intent”?