Hey Guys I have four integer array lists which were created after parsing a json file:
JSONObject o = new JSONObject(s);
JSONObject c = new JSONObject(s);
JSONArray a = o.getJSONArray("posts");
o = a.getJSONObject(0);
c = a.getJSONObject(1);
lat.add((int) (o.getDouble("Latitude")* 1E6));
lng.add((int) (o.getDouble("lontitude")* 1E6));
lat1.add((int) (c.getDouble("Latitude")* 1E6));
lon1.add((int) (c.getDouble("lontitude")* 1E6));
In the long run I would like to loop through these lists to get all the longitude and latitude values, but for now I am getting the 1st two values. My problem is that the application force closes and I think their is something wrong when I create the geocodes:
GeoPoint point = new GeoPoint( (int) lat.get(1), (int) lng.get(1));
OverlayItem overlayitem = new OverlayItem(point, "", "");
GeoPoint point1 = new GeoPoint((int) lat1.get(1), (int) lon1.get(1));
OverlayItem overlayitem1 = new OverlayItem(point1, "", "");
If anyone could knows what im doing wrong it would be a great help thanks
1 Answer