如何禁用屏幕固定中生成的Toast消息? [英] How to disable Toast Messages generated in Screen Pinning?

查看:129
本文介绍了如何禁用屏幕固定中生成的Toast消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发锁屏应用程序,并且我想禁用主页按钮,

i'm developing lockscreen application, and i want to disable home button,

我的应用是-设备所有者和设备管理员

my app is - Device Owner and Device Administrator

现在我正在使用屏幕固定禁用主页"按钮.

now i'm usnig screen pinning for disable home button.

但是,如果我每次都收到消息屏幕固定"并关闭屏幕固定"时开始活动,如果单击主页,则您的组织不允许取消固定"

but if i started activity each time i get msg "Screen pinned" and on close "Screen Unpinned" and if click on home then, "Unpinning isn't allowed by your organisation"

我想删除所有这些吐司消息.

I want to remove all those toast messages.

推荐答案

假定您使用ADB将您的应用列为设备所有者,则可以使用类似的命令提示符来禁用所有Toast消息:

Assuming you used the ADB to list your app as a Device Owner, you can use a similar command prompt to disable all toast messages:

adb shell appops set android TOAST_WINDOW deny

为使此命令生效,请使用cd到adb.exe所在的目录(除非将其添加到PATH).这将禁用所有已发送的Toast消息到已连接的android设备(虚拟或非虚拟).如果有多个设备,将选择找到的第一个设备.

For this command to work, cd to the directory where your adb.exe resides (except if you added it to the PATH). This will disable all toast messages to the android device that is connected (virtual or not). If there are multiple devices, the first one found will be selected.

这篇关于如何禁用屏幕固定中生成的Toast消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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