Android-如何检查是否启用了开发人员选项 [英] Android - How to check if Developer option is enabled

查看:607
本文介绍了Android-如何检查是否启用了开发人员选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查用户的设备上是否启用了开发人员选项?
(没有激活adb通讯或调试USB的情况,我只需要知道是否启用了Developer Option)。

How can I check if the user has developer option enabled on its device? (not with adb comunication active, or debug USB active, I need to know only if Developer Option are enabled).

我已经尝试了以下解决方案:
如何以编程方式检查应用程序是否在调试模式下运行?
,但这对我不起作用。
预先感谢

I've tried this solution: How to check programmatically whether app is running in debug mode or not? but it doesn't work for me. Thanks in advance

推荐答案

请尝试以下操作:

int adb = Settings.Secure.getInt(this.getContentResolver(),
                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);

这篇关于Android-如何检查是否启用了开发人员选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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