Android: Anyway to know if 'Unknown Sources' is checked?

≯℡__Kan透↙ 提交于 2019-12-07 21:16:52

问题


Is there any way to find out if the user has checked the 'Unknown Sources' checkbox in the 'Application settings' menu?


回答1:


You can use the INSTALL_NON_MARKET_APPS setting. Something like that :

boolean canInstallFromOtherSources = Settings.Secure.getInt(Settings.Secure.INSTALL_NON_MARKET_APPS) == 1;


来源:https://stackoverflow.com/questions/4594503/android-anyway-to-know-if-unknown-sources-is-checked

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!