转自http://iriverman.iteye.com/blog/807965

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. Fragment切换页面
  2. Android进入页面开始就自动弹出软键盘
  3. Android引导页面的实现
  4. Android原生页面(练手任务)
  5. Android setting各子页面地址
  6. H5页面调用android方法传json格式
  7. android实现页面背景的左右移动

随机推荐

  1. Android 程序之My Dictionary【凡尘英语
  2. iOS狂暴之路(开始篇)---学习路线总结
  3. Android 开发神器系列(工具篇)之 Android
  4. Android(安卓)大图预览、高效大图加载
  5. Android应用开发提高系列(1)——《Practica
  6. Android(安卓)AppWidget(桌面小部件-音乐
  7. Android: Android(安卓)设计思想
  8. ClockworkMod Recovery瀹炵幇搴旂敤andro
  9. 谈话....
  10. Android 的输入法适配设置windowSoftInpu