禁用Android的主页按钮4.0+ [英] Disable Home button in Android 4.0+

查看:94
本文介绍了禁用Android的主页按钮4.0+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图取代股票锁屏与我自己的应用程序。
在我的code,我要禁用的Home键。
我知道如何做到这一点的是Android 2.3及以下,
但同样的code不与Android合作4.0+(返回到桌面时,Home键pressed)

最近我发现了名为MiHome一个应用程序,它有自己的锁屏,并能够禁用的主页按钮。
有谁知道它是如何达到这个???

I'm trying to replace the stock lock screen with my own app.
In my code, i want to disable the Home button.
I know how to do this in Android 2.3 and below,
but the same code doesn't work with Android 4.0+ (return to desktop when Home button pressed)

Recently I found out an app called MiHome which has its own lock screen and is able to disable the Home button.
Does anyone know how it achieves this???

推荐答案

有没有办法拦截在Android的主页按钮,除非你让你的应用程序中的主屏幕上。这是出于安全原因,使恶意应用不能被重写所有可以退出按钮接管您的设备。 home键是一个肯定拍的方式,能够留下任何应用程序。

There is no way to intercept the home button on Android, unless you make your app the home screen. This is for security reasons, so that malicious apps cannot take over your device by overriding all the buttons that can exit. The home button is the one sure shot way to be able to leave any app.

如果你要处理的HOME按键,实现主屏幕。

If you want to handle the HOME button, implement a home screen.

这篇关于禁用Android的主页按钮4.0+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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