【问题标题】:how to disable both the notification bar and home button in android 2.3?如何在 android 2.3 中同时禁用通知栏和主页按钮?
【发布时间】:2013-03-31 05:50:33
【问题描述】:

我正在为 android 制作一个锁屏应用程序,因此它需要禁用通知栏和主页按钮。 由于 ICS 和其他版本不允许禁用 Home 按钮,有没有办法在以前的版本中做到这一点?

【问题讨论】:

    标签: android locking lockscreen


    【解决方案1】:

    您可以将此 sn-p 添加到您的活动中:

    @override
    
    public void onAttachedToWindow()
    {  
           this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);     
           super.onAttachedToWindow();  
    }
    

    但在 ICS 和果冻豆中不起作用,并且会在应用程序中崩溃。有关更多详细信息,请参阅以下参考:

    Android - Is It possible to disable the click of home button

    What does this 4 line java code means in android application?

    【讨论】:

      【解决方案2】:

      在此处查看最后一个答案...这是一种解决方法,但很有意义

      Not able disable Home button on specific android devices

      【讨论】:

        猜你喜欢
        • 2013-02-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-20
        相关资源
        最近更新 更多