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

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

1.需要setIsNeedAddress(true);

  LocationClientOption option = new LocationClientOption();
  option.setIsNeedAddress(true);
  mLocClient.setLocOption(option);

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

  

原文地址:https://www.cnblogs.com/yongfengnice/p/9483086.html