I have 4 activities as activity1, activity2, activity3, and activity4.
I access these activities from main activity which has four buttons, each button opens a specific activity, for example button1 opens activity1 through an intent.
In these four activities I have a method which checks to see if user is logged in to firebase or not, if user is not logged the login activity opens. So here comes my problem:
When the user clicks the login button, i want him to be directed to the intended activity.
If for example he wants to open activity1, but then directed back to login activity, when he logs in he should go to activity1,
Under onclick listerner of the login button i have this intent:
Intent intent = new Intent(Login.this, activity1.class); startActivity(intent) This works when user actually whats to go to activity1, what if he wants to go to any other activity?
Intentand use a property to indicate the destination to be used in the login activity. Seeextrasin Intent.