为什么我这样问:(也是在应用程序中尝试它的原因)
当我们在Lollipop中使用Google地图时会发生这种情况.即使位置已禁用,也会在用户从地图应用输入后以高精度模式打开,而无需访问"设置".
可以实现类似的功能以启用蓝牙,其中操作在我的应用程序中启动; 用户需要做出选择,但用户不会重定向到"设置",使用:
startActivity(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE));
哪个可以在BluetoothAdapter上找到,现在我们知道没有LocationAdapter,所以我环顾了gms-> LocationServices,基本上几乎所有的位置API引用,android.location.LocationManager,但似乎没有任何像ACTION_REQUEST_ENABLE现在可用.
希望有相同的其他方法,更多人尝试过.
请注意:
context.startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));不起作用.
android android-location google-play-services android-settings android-5.0-lollipop
android ×1