程序截图是否允许从未知来源安装

问题描述 投票:0回答:4

the是使用上述设置的代码:

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

此外,向用户显示设置可能很有用:
android settings
4个回答
27
投票
if (!isNonPlayAppAllowed) { startActivity(new Intent(android.provider.Settings.ACTION_SECURITY_SETTINGS)); }

此设置称为“

install_non_market_app”(单击文档)

.
(我基本上已经键入了这个问题,当我发现文档中隐藏了一个不同的名称中的答案时,我决定发布问题和自我答案,因为这不是微不足道的。)


5
投票
applicationContext.packageManager.canRequestPackageInstalls()
    

1
投票
© www.soinside.com 2019 - 2025. All rights reserved.