I have a movie ticket booking app. My initial activity is the login activity where there is a "continue as guest" option in case he doesn't want to sign in or register.
Then there is the details activity, where you can see the movie details, which has a button to allow the user to book the movie, BUT ONLY if he is signed in. if not, then it opens an alert dialog to register or sign in.
What I want to do is, if he is going to the Login activity from the details activity, then I want, after signing in, to return to details activity.
BUT if the user is in the Login activity when he opens the app, then he should go to the movie list activity.
Use
sharedpreferences
to save your credentials. Example :Note: activityfromwhereusermoved is whether directlogin or DetailsPage
and check this in
LoginActivity
thestring
value of yourkey Activity
like :check this link .. Sp!! and Sp_Dev!! for more on
saredpreference