判断GPS定位服务是否打开
来源:互联网 发布:mac 视频播放器推荐 编辑:程序博客网 时间:2024/05/21 14:42
/**
* Gps是否打开
* 需要<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />权限
*
* @param context the context
* @return true, if is gps enabled
*/
public static boolean isGpsEnabled(Context context) {
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
* Gps是否打开
* 需要<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />权限
*
* @param context the context
* @return true, if is gps enabled
*/
public static boolean isGpsEnabled(Context context) {
LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
0 0
- 判断GPS定位服务是否打开
- 【Android】- Android判断GPS定位是否打开弹出对话框
- android判断gps是否打开
- Android 判断GPS是否打开
- Android判断gps是否打开
- 工作积累-判断GPS是否打开
- 判断是否连接网络,当前网络类型,Gps是否打开
- Android判断是否连接网络或者是否打开了GPS
- Android定位入门(2)判断GPS是否开启
- Android之检测GPS服务和定位权限是否开启
- 判断是否开启定位服务的方法
- IOS 判断定位服务是否开启代码
- android gps 定位服务
- 调用GPS定位服务
- 判断gps是否开启
- 判断gps是否开启
- 判断GPS是否开启
- 判断gps是否开启
- 【SDOI2011】【BZOJ2244】拦截导弹
- C++实现RTMP协议发送H.264编码及AAC编码的音视频,摄像头直播
- SDWebImage,缓存下载,缓存管理,
- RemoteControl应用介绍
- cocos2d-x移植到android如何读取Excel文件
- 判断GPS定位服务是否打开
- 东汉官职列表
- Java调用Kettle执行任务或转换
- SQL SERVER数据库备份时出现“操作系统错误5(拒绝访问)。”错误的解决办法
- PHP Memcache详解
- poi 单元格内容换行
- Win10无法重置
- Hql group by unexpected AST node
- new String(getBytes(ISO-8859-1),GBK)解决中文乱码问题分析