如何禁用状态栏/通知栏上的机器人编程? [英] How to disable status bar / notification bar on android programmatically?

查看:168
本文介绍了如何禁用状态栏/通知栏上的机器人编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个锁屏应用程序。这个程序是由短信引发的..收到包含命令短信的时候,它会显示一个锁屏的活动。

i create a lockscreen application.. this application is triggered by SMS.. when a SMS containing command was received, it will display a lock screen activity.

我的锁屏酶活性使用TYPE_KEYGUARD禁用主屏幕按钮。当设备屏幕关闭,然后我再次打开它,我的问题是状态栏/通知栏仍然会出现在我的屏幕上。这是一个问题,因为用户仍然可以通过状态栏/通知栏访问某些程序即使设备已被锁定。所以我想dissapear这个状态栏/通知栏,使用户(盗窃)无法访问该设备了.. 请帮我解决这个问题。

my lockscreen activity is using TYPE_KEYGUARD for disabling a home screen button. When device screen turn off and then i turn it on again, my problem is status bar / notification bar still appear on my screen. this is a problem because the user still can access some program through status bar / notification bar even the device is being locked. so i want to dissapear this status bar / notification bar so that the user (theft) can't access that device anymore.. Please help me to solve this..

推荐答案

我认为你试图做的是编程方式设置的活动为全屏什么。如果是这样,请考虑以下内容:

I think what you're trying to do is programmatically set an activity as fullscreen. If so, consider the following:

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                     WindowManager.LayoutParams.FLAG_FULLSCREEN);

来源:<一href="http://www.androidsnippets.com/how-to-make-an-activity-fullscreen">http://www.androidsnippets.com/how-to-make-an-activity-fullscreen

这篇关于如何禁用状态栏/通知栏上的机器人编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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