0
点赞
收藏
分享

微信扫一扫

百度定位 bdLocation.getCity() 一直返回null

凯约 2022-05-17 阅读 101

百度定位 bdLocation.getCity() 一直返回null的原因:

1.需要setIsNeedAddress(true);

  LocationClientOption option = new LocationClientOption();

  option.setIsNeedAddress(true);

  mLocClient.setLocOption(option);

2.如果使用GPS定位,则需要用户打开GPS定位功能。默认是优先GPS定位的,可以改为优先网络定位。





举报

相关推荐

0 条评论