diff options
Diffstat (limited to 'main/src/cgeo/geocaching/cgeopoint.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgeopoint.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/cgeopoint.java b/main/src/cgeo/geocaching/cgeopoint.java index 025b96a..e399a97 100644 --- a/main/src/cgeo/geocaching/cgeopoint.java +++ b/main/src/cgeo/geocaching/cgeopoint.java @@ -207,7 +207,7 @@ public class cgeopoint extends AbstractActivity { private List<Destination> getHistoryOfSearchedLocations() { if (historyOfSearchedLocations == null) { // Load from database - historyOfSearchedLocations = app.getHistoryOfSearchedLocations(); + historyOfSearchedLocations = cgData.loadHistoryOfSearchedLocations(); } return historyOfSearchedLocations; @@ -304,7 +304,7 @@ public class cgeopoint extends AbstractActivity { } } - private class changeDistanceUnit implements OnItemSelectedListener { + private static class changeDistanceUnit implements OnItemSelectedListener { private changeDistanceUnit(cgeopoint unitView) { this.unitView = unitView; @@ -393,7 +393,7 @@ public class cgeopoint extends AbstractActivity { getHistoryOfSearchedLocations().add(0, loc); // Save location - app.saveSearchedDestination(loc); + cgData.saveSearchedDestination(loc); // Ensure to remove the footer historyListView.removeFooterView(getEmptyHistoryFooter()); @@ -405,7 +405,7 @@ public class cgeopoint extends AbstractActivity { getHistoryOfSearchedLocations().remove(destination); // Save - app.removeSearchedDestinations(destination); + cgData.removeSearchedDestination(destination); if (getHistoryOfSearchedLocations().isEmpty()) { if (historyListView.getFooterViewsCount() == 0) { @@ -424,7 +424,7 @@ public class cgeopoint extends AbstractActivity { getHistoryOfSearchedLocations().clear(); // Save - app.clearSearchedDestinations(); + cgData.clearSearchedDestinations(); if (historyListView.getFooterViewsCount() == 0) { historyListView.addFooterView(getEmptyHistoryFooter()); @@ -487,8 +487,6 @@ public class cgeopoint extends AbstractActivity { } private Geopoint getDestination() { - Geopoint result; - Geopoint coords; String bearingText = ((EditText) findViewById(R.id.bearing)).getText().toString(); // combine distance from EditText and distanceUnit saved from Spinner @@ -502,6 +500,7 @@ public class cgeopoint extends AbstractActivity { return null; } + Geopoint coords; if (StringUtils.isNotBlank(latText) && StringUtils.isNotBlank(lonText)) { try { coords = new Geopoint(latText, lonText); @@ -518,6 +517,7 @@ public class cgeopoint extends AbstractActivity { coords = app.currentGeo().getCoords(); } + Geopoint result; if (StringUtils.isNotBlank(bearingText) && StringUtils.isNotBlank(distanceText)) { // bearing & distance double bearing; |
