Capture double click on Home button
-
09-07-2021 - |
Question
I have Samsung Galaxy S2 and here I can double click Home button to run an app (i.e. Voice Talks)
I wonder if it is possible to create an application (broadcast or activity with Intent Filters) which will capture double click on home button?
Solution
I am not sure if there is default functionality for capturing double click of home button, but you can try this
- Capture home button click
- Start a timer on first home button click for a fixed period (say 2 seconds)
- Wait for the time period, and listen for next home button click
- If second click is observed in given time period, do the double click functionality else stick to default functionality of home button
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow