Reputation: 1866
In my application, a user can post comments only after logging in. So when a user clicks on comment activity, he/she will be redirected to login page and after successful login, he/she should redirect to that activity.
In this situation, I used startactivityfor result()
, but it shows the page loading again. So when I click back button (using finish()
), it again shows the same page.
I want to load the page only once.
Does anybody knows how to accomplish this?
Upvotes: 0
Views: 413
Reputation: 1746
You can use use dialogue box for login for your comment activity. Let the user be on the same page, enable the user to login through the dialogue box and if the user enters the correct credentials let the user post the comment else show a toast instead.
Upvotes: 0
Reputation: 1787
Use sharedpreferences to save the state of users login, When the user enters ur loginscreen, if he is already logged in before, set flag as true and direct him to main page else false and ask him to log in again
Upvotes: 1