# How to catch the device back key event?

**URL:** <https://forum.adalo.com/t/how-to-catch-the-device-back-key-event/2252>\
**Category:** Get Help\
**Created:** [July 1, 2020, 2:57pm UTC](https://forum.adalo.com/t/how-to-catch-the-device-back-key-event/2252 "2020-07-01T14:57:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tjd\_15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tjd_15/32/1268_2.png) [@tjd\_15](https://forum.adalo.com/u/tjd_15)\
**Post date:** [July 1, 2020, 5:47pm UTC](https://forum.adalo.com/t/how-to-catch-the-device-back-key-event/2252/2 "2020-07-01T17:47:27Z")

</div>

Hi @ChristopheHK

I had a use case where I had to implement a voting app. Imagine if you enter a voting booth, and you can cast your vote or not cast, but once you enter the booth and exit, you cannot enter the ‘voting booth’ screen again.

I used a logical variable in the user’s collection, whose value I set once that user visited the screen. You can do this in the editor by clicking on the screen -\> ‘When user visits the screen’ -\> Action, etc.

Navigation to that screen could be conditional, where your logical variable is of your choice (true/false, numerical, etc.).

Once the user voted, I then pushed the user to pass through a series of blank screens with transition as ‘none’, before ending up on the screen I desired. Again, with the same ‘When user visits the screen’ -\> Action, etc., this time on the blank screen.

It worked perfectly.

The other way to do this is to not keep default action as ‘back’ via the back icon / left icon on the app bar. Instead you make the action as link to screen, even if it is the previous screen. This forces a new load of the screen and acts as a refresh.

Of course this doesn’t prevent navigation by hitting back button on user device. Only the first method I described above does.

I recommend either using a new flag column (in any table) which sets on sign-in + resets on visiting screen, or creating a ‘Flag’ collection which makes a new entry in the collection when user visits the screen. The checking condition for screen visibility is Logged in user -\> count in the flag collection -\> today = 0.

---

_[View the full topic](https://forum.adalo.com/t/how-to-catch-the-device-back-key-event/2252)._
