当自定义锁在安卓screenis在Android Home键关闭 [英] Android Home button disable when Custom lock screenis ON in android

查看:202
本文介绍了当自定义锁在安卓screenis在Android Home键关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是创建自定义的LockScreen,使用下面的链接<一个href="http://$c$c.google.com/p/contactowner/source/browse/#svn%2Ftrunk%2Fsrc%2Fcom%2Fappengine%2Fparanoid_android%2Flost" rel="nofollow">http://$c$c.google.com/p/contactowner/source/browse/#svn%2Ftrunk%2Fsrc%2Fcom%2Fappengine%2Fparanoid_android%2Flost我能够创建工作的罚款。但我的问题是,当我preSS HOME按钮,它是开放的启动画面。 (1)如何阻止在Android主键? (2)如果是不可能的,怎么一些自定义锁屏在Android Market能够阻止Home键。.apks

My requirement is to create Custom LockScreen, using below link http://code.google.com/p/contactowner/source/browse/#svn%2Ftrunk%2Fsrc%2Fcom%2Fappengine%2Fparanoid_android%2Flost i am able to create working Fine. But my Problem is when i press HOME button it is opening the Launcher screen. (1) How to Block home button in android ? (2)If it is not possible, How few custom lock screen .apks in the android market able to block Home button.

我怎样才能做到这一点?

How can i achieve that ?

鸭preciate你的帮助......

Appreciate your help...

推荐答案

您不能拦截键和做到这一点,除非你有机会到Android源$ C ​​$ c和可以改变它。从应用程序的角度来看,你可以,除非你有源要么不能做到这一点。请记住,这是在Android中皱起了眉头。

You cannot intercept the key and do this unless you have access to the android source code and can change it. From an app's perspective, you can't do this unless you have the source either. Keep in mind that this is Frowned upon in android.

所以,你必须提供的唯一事情是onUserLeaveHint(),这是从活动的方法。但你还是不能从回家阻止用户。

So the only thing you have available is onUserLeaveHint() which is a method from an Activity. But you still CANNOT stop a user from going home.

编号:

http://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()

下面是证明你不能直接做

Here is proof that you cannot do it directly

    public static final int KEYCODE_HOME

    Since: API Level 1
    Key code constant: Home key. This key is handled by the 
framework and is never delivered to applications.
    Constant Value: 3 (0x00000003)

这篇关于当自定义锁在安卓screenis在Android Home键关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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