How do you set Backpressed Screen once, twice, or more until close application?

Help me, I want to make Screen when backpressed once=clear all, twice=go to other screen, and 3 times or more=close the app..

How would anyone know that, let alone understand it?

1 Like

Perhaps code like this will work. The code works fine on my Samsung cell and LG cell to post 1,2,3 to a Label and then start all over again. :wink:

Adapt the code to clear all, go to another screen and close app instead of posting 1,2,3

1 Like

How would you know when the user has stopped pressing Back, to settle on a count and act on that count?

1 Like

I guess you could introduce a clock timer (say 2000ms), which gets the click number value when it fires?


I try this, but the clock didn't work. can anyone help?

backPressed.aia (7.9 KB)

1 Like

Here's my take, no counter and no clock:
back_counter.aia (3.7 KB)
sample run

Note: This only works when built, not in the Companion.

Also note how I do not open Screen1, only close Screen2 to return to Screen1.

There are more advanced ways to switch screens.

1 Like

Totally nice, it worked when i used this

and then at the screen1, when backpressed-close the application

Thank's all for your knowledge to guide me :pray:

Let me suggest you to switch screens correctly to avoid unexpected results...


1 Like

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