Hi Guys,
I am having some difficulties trying to prompt a user before the app closes when the back button is pressed on a device. The example is as follows:
on closeStack
global timer
put "2" into timer
send "mouseDown" to image "StartButton"
pass closeStack
end closeStack
No matter what I do, the App continues to exit after the back button is pressed.
Any help will be appreciated.
Many Thanks,
Googie.
Prompting before "on closeStack"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Prompting before "on closeStack"
Hi,Googie85 wrote: No matter what I do, the App continues to exit after the back button is pressed.
You can check in the dictionary: closeStackRequest
Handle the closeStackRequest message if you want to prevent a stack from being closed.
HTH,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
Re: Prompting before "on closeStack"
Hi Googie,
and there is really no need to put NUMBERS into quotes!
Best
Klaus
and there is really no need to put NUMBERS into quotes!
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 7214
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Prompting before "on closeStack"
You need to trap the backKey message. Android OS will quit the app if you don't handle backKey, so you need to handle it on every card. Use it to navigate within the stack the same way any navigation arrows do (if the card has those) or just don't pass the message if you don't want backKey to do anything (but users will hate you if you disable it.)
You can use the same handler you're using now for closeStack and just change the message name to backKey.
You can use the same handler you're using now for closeStack and just change the message name to backKey.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com