如何禁用状态栏/通知栏上的机器人编程?机器人、状态栏、栏上、通知

2023-09-07 04:17:26 作者:烟雨洛神

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

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);

来源:http://www.androidsnippets.com/how-to-make-an-activity-fullscreen