有没有一种方法,以检查是否与QUOT;来源不明&QUOT安装;在Android上启用? [英] Is there a way to check if "Install from unknown source" is enabled on Android?

查看:77
本文介绍了有没有一种方法,以检查是否与QUOT;来源不明&QUOT安装;在Android上启用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要提示用户如果未启用该选项。

I want to prompt the user if this option is not enabled.

推荐答案

下面是另一种方式来检查此设置:

Here is another way to check this setting:

boolean isNonPlayAppAllowed = Settings.Secure.getInt(getContentResolver(), Settings.Secure.INSTALL_NON_MARKET_APPS) == 1;

另外这款code,以显示设置用户可能我有用的:

Also this code to show the setting to user might me useful:

if (!isNonPlayAppAllowed) {
    startActivity(new Intent(android.provider.Settings.ACTION_SECURITY_SETTINGS));
}

这篇关于有没有一种方法,以检查是否与QUOT;来源不明&QUOT安装;在Android上启用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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