This commit is contained in:
sonora 2013-06-11 22:19:53 +02:00
parent e0c64e0ca8
commit 70afb5a56d
2 changed files with 4 additions and 4 deletions

View file

@ -1063,7 +1063,7 @@ public class OsmandSettings {
return settingsAPI.edit(globalPreferences).remove(INTERMEDIATE_POINTS).commit();
}
public List<String> getIntermediatePointDescriptions() {
public List<String> getIntermediatePointDescriptions(int sz) {
List<String> list = new ArrayList<String>();
String ip = settingsAPI.getString(globalPreferences,INTERMEDIATE_POINTS_DESCRIPTION, "");
if (ip.trim().length() > 0) {
@ -1099,7 +1099,7 @@ public class OsmandSettings {
public boolean insertIntermediatePoint(double latitude, double longitude, String historyDescription, int index,
boolean navigate) {
List<LatLon> ps = getIntermediatePoints();
List<String> ds = getIntermediatePointDescriptions();
List<String> ds = getIntermediatePointDescriptions(ps.size());
ps.add(index, new LatLon(latitude, longitude));
ds.add(index, historyDescription);
if(navigate) {
@ -1112,7 +1112,7 @@ public class OsmandSettings {
}
public boolean deleteIntermediatePoint( int index) {
List<LatLon> ps = getIntermediatePoints();
List<String> ds = getIntermediatePointDescriptions();
List<String> ds = getIntermediatePointDescriptions(ps.size());
ps.remove(index);
ds.remove(index);
return saveIntermediatePoints(ps,ds);

View file

@ -31,7 +31,7 @@ public class TargetPointsHelper {
intermediatePoints.clear();
intermediatePointNames.clear();
intermediatePoints.addAll(settings.getIntermediatePoints());
intermediatePointNames.addAll(settings.getIntermediatePointDescriptions());
intermediatePointNames.addAll(settings.getIntermediatePointDescriptions(intermediatePoints.size()));
}
public LatLon getPointToNavigate() {