1. 程式人生 > >百度定位中出現4.9E-324

百度定位中出現4.9E-324

public class MyLocationListener implements BDLocationListener {


@Override
public void onReceiveLocation(BDLocation location) {

if(location!=null){
this.location=location;

中新增

//錯誤程式碼,如果定位失敗會返回這樣的經緯度[4.9E-324, 4.9E-324]      

if(62==location.getLocType()||63==location.getLocType()||67==location.getLocType()||(161<location.getLocType() && location.getLocType()<168)){
this.location=null;

}

定位失敗,location物件沒有意義。

如果一直失敗,換手機試試