fix build

This commit is contained in:
sonora 2015-01-02 19:55:32 +01:00
parent 2d5b853eb3
commit 1769542fea

View file

@ -69,13 +69,8 @@ public class DashFavoritesFragment extends DashBaseFragment {
if(!getMyApplication().getSettings().isLastKnownMapLocation()) { if(!getMyApplication().getSettings().isLastKnownMapLocation()) {
// show first time when application ran // show first time when application ran
location = getMyApplication().getLocationProvider().getFirstTimeRunDefaultLocation(); location = getMyApplication().getLocationProvider().getFirstTimeRunDefaultLocation();
loc = new LatLon(getMyApplication().getLocationProvider().getFirstTimeRunDefaultLocation().getLatitude(), getMyApplication().getLocationProvider().getFirstTimeRunDefaultLocation().getLongitude());
} else { } else {
location = getLocationProvider().getLastKnownLocation(); location = getLocationProvider().getLastKnownLocation();
loc = new LatLon(getLocationProvider().getLastKnownLocation().getLatitude(), getLocationProvider().getLastKnownLocation().getLongitude());
}
if (loc == null) {
loc = getMyApplication().getSettings().getLastKnownMapLocation();
} }
updateLocation(location); updateLocation(location);
} }
@ -180,11 +175,17 @@ public class DashFavoritesFragment extends DashBaseFragment {
} }
public void updateLocation(Location location) { public void updateLocation(Location location) {
if (location == null){ //if (location == null) {
return; // return;
//}
if (location != null) {
this.location = location;
loc = new LatLon(location.getLatitude(), location.getLongitude());
} }
this.location = location; if (loc == null) {
this.loc = new LatLon(location.getLatitude(), location.getLongitude()); loc = getMyApplication().getSettings().getLastKnownMapLocation();
}
this.loc = loc;
updateArrows(); updateArrows();
} }