/**     * 打开GPS     */    public static void openGPSSettings(Context context) {        LocationManager locationManager = (LocationManager) context                .getSystemService(Context.LOCATION_SERVICE);        if (locationManager.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)) {            Log.d(TAG, "已開啟GPS");            return;        } else {            Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);            showToast(context, "請開啟GPS");            context.startActivity(intent);        }    }

更多相关文章

  1. Android开发-打开另一个Activity或打开网页
  2. Android打开/关闭免提(SpeakerPhone)
  3. 整理了下viewpagerTransformers框架的效果图
  4. android sensors 总结(四)
  5. Android(安卓)4.1打开相机(自己写的压力测试APK)
  6. 关于Android(安卓)emulator的proxy问题
  7. android打开文件、保存对话框、创建新文件夹对话框
  8. Cordova项目使用Android(安卓)Studio真机调试
  9. android中打开相机、打开相册进行图片的获取示例

随机推荐

  1. Android图形显示系统——下层显示4:图层合
  2. MaterialDesgin之MaterialTextField
  3. 关于Android进程知识,你需要知道这些(一)
  4. Android中图片实现按钮点击效果
  5. android依赖工程 java build path androi
  6. Android进阶 ——— Android官方架构组件
  7. Transformer Prime 变形平板:10 寸 Super
  8. Android系统build/core下.mk文件分析
  9. Android(安卓)轻松实现语音识别
  10. Android可折叠收缩伸展的Expandable分组R