判断gps并跳转到设置界面
来源:互联网 发布:微信转发赚钱平台源码 编辑:程序博客网 时间:2024/09/21 08:48
private void openGPSSettings() {LocationManager alm = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);if (alm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)) {Toast.makeText(this, "GPS模块正常", Toast.LENGTH_SHORT).show();return;}final AlertDialog dlg = new AlertDialog.Builder(this).create();dlg.show();Window window = dlg.getWindow();window.setContentView(R.layout.shrew_exit_dialog);TextView title = (TextView) window.findViewById(R.id.title);title.setText("请开启GPS!");Button ok = (Button) window.findViewById(R.id.btn_ok);ok.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);startActivityForResult(intent, 0); // 此为设置完成后返回到获取界面dlg.cancel();}});Button cancel = (Button) window.findViewById(R.id.btn_cancel);cancel.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {finish();}});}
0 0
- 判断gps并跳转到设置界面
- 安卓跳转到GPS设置界面
- android判断当前网络状态及跳转到设置界面
- 网络判断以及未联网是跳转到设置界面
- 网络判断跳转设置界面
- 判断当前的网络状态并跳转到系统设置
- 判断网络连接并跳到设置界面
- android 监听GPS是否打开跳转到设置GPS
- 跳转到wifi设置界面
- iOS跳转到设置界面
- Android 6.0动态权限及跳转GPS设置界面
- android端判断手机是否有网,并且无网时跳转到设置界面
- Android 判断应用程序获取通知栏权限是否开启,以及如何跳转到应用程序设置界面
- 判断网络连接,在没有开启网络的时候自动跳转到设置界面
- PyCharm使用技巧:Find Action(查找并跳转到设置界面)
- Android跳转到设置界面的方法
- iOS 跳转到系统设置界面
- android 自动跳转到系统设置界面
- 为什么支持向量机和感知机等问题都有原始和对偶问题之分
- 通过命令创建oracle11G数据库
- coco2dx编译so文件出错解决方法
- 杭电3549 Flow Problem(最大流Dinic+前向星模板)
- C#数字图像处理<二>
- 判断gps并跳转到设置界面
- sqlite 出现 unrecognized token: "xxxx"
- C#:Convert.ToInt32(String)和Int32.Parse(String)的区别
- jQuery验证框架(八)应用实例 (jQuery validation)
- 重庆高清卫星地图(含道路标签数据叠加)
- 网站搭建基础知识、流程概括
- linux之sort用法
- explorer.exe 不响应的原因之一,可能也就我碰见了
- ArcGis旋转map上的图标