允许模拟位置
boolean isOpen = Settings.Secure.getInt(context.getContentResolver(),Settings.Secure.ALLOW_MOCK_LOCATION, 0) != 0;打开时,值是1,关闭时,值是0
本文介绍了一种检查设备是否允许模拟位置的方法,通过读取系统设置中的ALLOW_MOCK_LOCATION值来判断,该值为1表示允许,为0表示禁止。
允许模拟位置
boolean isOpen = Settings.Secure.getInt(context.getContentResolver(),Settings.Secure.ALLOW_MOCK_LOCATION, 0) != 0;打开时,值是1,关闭时,值是0
5190

被折叠的 条评论
为什么被折叠?