Mapview ConcurrentModification Exception

by Necroline » Mon, 28 Jun 2010 22:01:55 GMT


Sponsored Links
 ello everyone,

As the title suggest i have (sometimes) a
concurrentmodificationexception while trying to create a route between
two locations ...
Here is my code (and in case you're wondering MyOverlay does not try
to access the other Overlays in the map)

private class fillRouteTask extends AsyncTask<Void, GeoPoint,
Void> {

/**
* create the url to call to get the route
*
* @param src
* @param dest
* @return
*/
private StringBuilder createUrl(GeoPoint src, GeoPoint dest) {
// connect to map web service
StringBuilder urlString = new StringBuilder();

urlString.append("http://maps.google.com/maps?f=d&hl=en");
urlString.append("&saddr=");// from
urlString.append(Double
.toString((double) src.getLatitudeE6()
/ 1.0E6));
urlString.append(",");
urlString.append(Double
.toString((double) src.getLongitudeE6()
/ 1.0E6));
urlString.append("&daddr=");// to
urlString.append(Double
.toString((double) dest.getLatitudeE6()
/ 1.0E6));
urlString.append(",");
urlString.append(Double
.toString((double)
dest.getLongitudeE6() / 1.0E6));
urlString.append("&ie=UTF8&0&om=0&output=kml");
Log.d("xxx", "URL=" + urlString.toString());

return urlString;
}

/**
* create the connection to google url
*
* @param src
* @param dest
* @return
*/
private String connectToUrl(GeoPoint src, GeoPoint dest) {

// get the kml (XML) doc. And parse it to get the
// coordinates(direction
// route).
Document doc = null;
HttpURLConnection urlConnection = null;
URL url = null;
try {
url = new URL(createUrl(src, dest).toString());
urlConnection = (HttpURLConnection)
url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
urlConnection.setDoInput(true);
urlConnection.connect();

DocumentBuilderFactory dbf =
DocumentBuilderFactory
.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(urlConnection.getInputStream());

if
(doc.getElementsByTagName("GeometryCollection") != null



Mapview ConcurrentModification Exception

by Necroline » Mon, 28 Jun 2010 23:42:56 GMT


 ixed it, i removed the Overlays reference from the mapview and it
worked :)


On 28 juin, 16:01, Necroline <adeline.hul...@gmail.com> wrote:

--


Sponsored Links


Other Threads

1. android:horizontalSpacing

Hi,

at one place i have seen android:horizontalSpacing="-1px" in a grid
view.
what does it means? What is effect of setting spacing in -ve

-- 

2. citrix gateway access problem

Dear all,

I am developing an app to connect with an url and pass some data. But
url is blocked by citrix access gateway.
Through http get/post method I can not send login id or password cause
password field is hidden, in html source code.

Is there any way to solve the issue.


Thanks & regards
Arindam Ghosh

-- 

3. Map utk Ndrive

4. Javascript to call the NPAPI Plugin directly

5. Problem with adjustPan andadjustResize

6. simplified push notification integration

7. Customizing the UserAgent for browser.