GPS是否开启LocationManager locationManager = (LocationManager)getContext().getSystemService(Context.LOCATION_SERVICE);return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);进入GPS设置页面        Intent intent = new Intent();        intent.setAction(Settings.ACTION_LOCATION_SOURCE_SETTINGS);        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        try         {            getContext().startActivity(intent);                                        } catch(ActivityNotFoundException ex)         {                        // The Android SDK doc says that the location settings activity            // may not be found. In that case show the general settings.                        // General settings activity            intent.setAction(Settings.ACTION_SETTINGS);            try {                   getContext().startActivity(intent);            } catch (Exception e) {            }        }

更多相关文章

  1. Android(安卓)自定义BaseAdapter
  2. android中textview设置为多行文本时,如何让文字从最顶开始显示
  3. android ListView的分段显示、分页显示(附源码)
  4. android:autoLink
  5. [Android]开启/关闭/监听 飞行模式
  6. Android标题栏各种设置
  7. android 自定义dialog弹出和消失缩放动画
  8. android上传文件至服务器
  9. 修改进度条ProgressBar颜色

随机推荐

  1. android的PowerManager和PowerManager.Wa
  2. Android画图之Matrix(二)
  3. Android(安卓)Studio gradle配置详解
  4. android设置背景色为透明
  5. android使用adb命令安装软件
  6. Android控件阴影效果的几种实现方法
  7. 详解Android主流框架不可或缺的基石
  8. android sqlite 数据类型
  9. Android(安卓)adb的使用略解
  10. 在android中创建圆角的文本框的实现