为了账号安全,请及时绑定邮箱和手机立即绑定

检测GPS或者网络是否可用

检测GPS或者网络是否可用

月关宝盒 2019-03-14 18:15:32
需要检测GPS或者WiFi或者手机网络是否可用,我当前的代码可以检测出GPS。但是检测网络时就报错:The method isProviderEnabled(String) in the type LocationManager is not applicable for the arguments (String, String)代码:if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER)){             Toast.makeText(this, "GPS is Enabled in your device", Toast.LENGTH_SHORT).show();         }else{             displayAlert();         }
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 483 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号