开启或关闭状态的Andr​​oid GPS [英] Android GPS on or off state

查看:128
本文介绍了开启或关闭状态的Andr​​oid GPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法来检查Android的GPS是没有任何许可或关闭,只是状态我不需要切换。

Is there any way to check if the Android GPS is on or off without any permission, just the state I don't need to toggle it.

感谢

推荐答案

没有。检查GPS状态在Android上要求

No. Checking GPS Status on Android requires

android.permission.ACCESS_FINE_LOCATION

在code,检查GPS状态

The code to check the status of GPS


 LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE );
 boolean statusOfGPS = manager.isProviderEnabled(LocationManager.GPS_PROVIDER);

这篇关于开启或关闭状态的Andr​​oid GPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆