Android的Home键长preSS [英] Android Home button Long press

查看:214
本文介绍了Android的Home键长preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作是在公共APP在android系统如 型Surelock ,我面临处理Android主键长preSS事件的问题。请建议我如何处理Home键长preSS事件。

I am working on kiosk APP in android like SureLock, i am facing the problem to handle the android home button long press event. Please suggest me how to handle Home button long press event.

推荐答案

使用的code在<一个href=\"http://stackoverflow.com/questions/10810038/how-to-catch-the-home-button-click-in-android\">this回答捕捉home键键按下事件,并在的onkeyup 减去次事件之间并决定是否它是一个长期的preSS与否(1秒,我倒是说什么?)

Use the code in this answer to capture the home button key down event, and in onKeyUp subtract the times between the events and decide whether it is a long press or not (1 second, I'd say?)

这篇关于Android的Home键长preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆