简体   繁体   English

捕获双击主页按钮

[英]Capture double click on Home button

I have Samsung Galaxy S2 and here I can double click Home button to run an app (ie Voice Talks) 我有Samsung Galaxy S2,在这里我可以双击“主页”按钮来运行应用程序(即语音对话)

I wonder if it is possible to create an application (broadcast or activity with Intent Filters) which will capture double click on home button? 我想知道是否有可能创建一个应用程序(广播或带有意图过滤器的活动)来捕获双击主屏幕按钮的情况吗?

I am not sure if there is default functionality for capturing double click of home button, but you can try this 我不确定是否存在用于捕获主页按钮双击的默认功能,但是您可以尝试执行此操作

  1. Capture home button click 捕获主页按钮单击
  2. Start a timer on first home button click for a fixed period (say 2 seconds) 在第一次单击主屏幕按钮时启动计时器一段固定的时间(例如2秒钟)
  3. Wait for the time period, and listen for next home button click 等待一段时间,然后等待下一次主页按钮单击
  4. If second click is observed in given time period, do the double click functionality else stick to default functionality of home button 如果在给定时间段内观察到第二次点击,请执行双击功能,否则坚持使用主页按钮的默认功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM