Question 1:
I have a function that is called every time I get a new Lat Long value, I would like to add these Lat Long values to a list but every time I get a new value the list is over written with the last value (not appended).
My code (with only latitude)
public void getDistance() {
List<String> list = new ArrayList<String>();
list.add(latitudeString);
System.out.println("list: "+list);
}
Question 2:
Once I have values in the list (which will increase as values change) I would like to get the last two values everytime the list changes and perform some function (get distance between last two Lat Long values in list and so on..)