由网友(阳光点的,阳光温暖的)分享简介:我要提示用户如果未启用该选项。I want to prompt the user if this option is not enabled.推荐答案下面是另一种方式来检查此设置:Here is another way to check this setting:boolean isNonPlayAppAll...
我要提示用户如果未启用该选项。
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));
}
相关推荐
最新文章