在BDAbstractLocationListener接口回调中处理:

public class MyLocationListener extends BDAbstractLocationListener {
    @Override
    public void onReceiveLocation(BDLocation location){
        if (null != location && "4.9E-324".equals(String.valueOf(location.getLatitude())))
            return;
        if (null != location 
                && location.getLocType() != BDLocation.TypeServerError 
                && location.getLocType() != BDLocation.TypeServerCheckKeyError) {
            //编写你的代码
        }
    }
}

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐