How to handle the home key on Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

How to handle the home key on Android

Post by sphere » Wed Jan 24, 2018 8:44 pm

Hi,

since there is no command or handler available for the homeKey (the circle on many Android phones) and probably the same as the button...the app is not closed after tapping it. (so not the backKey or the menuKey)
I see app's who are really closed when tapping on that key, especcially banking apps.

I want that too, and not that the app stays open in memory.
It's ok for many apps, but for this app i want it to close.

How to do that.
Thanks for any help.

Sphere.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to handle the home key on Android

Post by MaxV » Thu Jan 25, 2018 12:32 pm

Did you try this?

Code: Select all

on iconifyStack
 close this stack
end iconifyStack
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to handle the home key on Android

Post by FourthWorld » Thu Jan 25, 2018 5:57 pm

Does the iconifyStack message get sent when going to the background on Android?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to handle the home key on Android

Post by jacque » Thu Jan 25, 2018 7:47 pm

No, iconifyStack is desktop only. As far as I know there's no workaround for the problem because there are no messages to trap. The app has no way of knowing that it's in the background. This has caused me some trouble too and I haven't been able to solve it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: How to handle the home key on Android

Post by sphere » Thu Jan 25, 2018 8:58 pm

Sorry MaxV according Jacque it's desktop only, thanks anyway.

Isn't it a matter that it could/should/has to be added to the LC engine, so it can be detected just at the moment of tapping like the backKey and then do something with it via a handler?

So perhaps as feature request?
I wonder how those other apps handle it.
Probably depending how and with what they are written.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to handle the home key on Android

Post by jacque » Thu Jan 25, 2018 10:39 pm

It's been an issue for a while now, there is a discussion in a bug report here:
http://quality.livecode.com/show_bug.cgi?id=20456

It doesn't directly address your question but the info is related. The bug has been "under review" for a few months so if you add a comment maybe they'll notice and take another look.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: How to handle the home key on Android

Post by sphere » Fri Jan 26, 2018 9:33 am

Thanks, i've added some comments to that report.

Post Reply

Return to “Android Deployment”