Questions regarding the action of going "back"

Goodmorning/goodafternoon.
So im testing my app on a Samsung Galaxy J7 Prime. App is working great, but i just have one problem.
Once i log out then press the back button (once im logged out) in puts me back on the app as a “user” but no credentials or anything. Is there anyway i can fix this, maybe a way i can prevent “backing”?
Thank you in advance for the help =)

1 Like

Hi @dunderkid,

What you can do, is to implement some type of “user check” upon entering the screen. Add an action for the screen, so if you don’t find user credentials (for example, email is empty), you redirect user to welcome screen.
However, there might be some roadblocks: there is a bug with “back” button, see the thread here Screen visit actions and "back" button and here How to control the android back button?.

What might work: you add an “interim” blank screen after logout, add some text like “you have been logged out” and a button to welcome screen. From this screen you automatically (on-enter screen action, if the user is not logged in, same user check) redirect user to welcome screen. And you also add “user check” on your pre-logout screen, as mentioned above.
The behaviour I expect is:

  • user logs out
  • he/she is redirected to “interim” screen, then 2nd redirect to welcome screen
  • user presses “back”, and gets to interim screen
    — if automatic redirection works, there is no problem
    — if bug is there, automatic action will not run. So user have an option to press the button and get to welcome screen
    — if user press back button again, he/she gets to “pre-logout” screen, and as I understand, bug doesn’t happen in this case and your “user check” will be run.

Please let me know if it worked for you.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.