PFlores81 Active Member Licensed User Longtime User Jun 26, 2012 #1 Is it possible to create a service that will listen for a longhold on the back key for instance. I have been reading pretty much all day.. Most concepts in android come easy to me but I cannot find a working solution for this one. Any help is very much appreciated. Thank you
Is it possible to create a service that will listen for a longhold on the back key for instance. I have been reading pretty much all day.. Most concepts in android come easy to me but I cannot find a working solution for this one. Any help is very much appreciated. Thank you
Erel B4X founder Staff member Licensed User Longtime User Jun 26, 2012 #2 The relevant events: KeyPress and KeyUp are raised in the activity. You can store the KeyPress time and then in KeyUp decide whether this is a long press or a short press. Upvote 0
The relevant events: KeyPress and KeyUp are raised in the activity. You can store the KeyPress time and then in KeyUp decide whether this is a long press or a short press.
PFlores81 Active Member Licensed User Longtime User Jun 26, 2012 #3 Will that work though if I have a portion of the app running as a service listening for this action? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jun 26, 2012 #4 No. You can only intercept key presses when your activity is visible. Upvote 0
PFlores81 Active Member Licensed User Longtime User Jun 26, 2012 #5 Interesting, thanks Erel. Ill have to find another way to implement the lock feature. Perhaps as a shortcut in the search key. Upvote 0
Interesting, thanks Erel. Ill have to find another way to implement the lock feature. Perhaps as a shortcut in the search key.