I had a similar problem with AsyncTask downloading and updating InfoWindow , and after I hit my head against the wall this morning, I came up with this little workaround that I hope will serve your needs while Google sorts this option.
I called marker.showInfoWindow() in the marker.showInfoWindow() method of my AsyncTask , which repeatedly called InfoWindowAdapter methods that ended in the loop and never propagated my changes correctly.
The solution I used was to save the selected marker and display the displayed InfoWindow text. I pulled up in the example below where the TextView updated on DownloadBubbleInfo AsyncTask (it looks like I'm using an image stream).
And the corresponding lines from DownloadBubbleInfo AsyncTask :
@Override protected String[] doInBackground(String... queryparts) { // Do the query and stash the results in queryResults and pass to // onPostExecute to attach to the mainview (the current view from the // main code) and then call showInfoWindow on the marker to re-launch // the InfoWindowAdapter methods again to repopulate the InfoWindow view // and attach it. return queryResults; } protected void onPostExecute(String[] results) { ((TextView) mainview.findViewById(R.id.tv_title)).setText(results[0]); ((TextView) mainview.findViewById(R.id.tv_info)).setText(results[1]); marker.showInfoWindow(); Log.i("Chris-Debug", "Reshowing InfoWindow"); }
Now all this should make sure that the correct marker is filled with the correct information obtained from your AsyncTask , and hey presto, another corner of the extremely inconvenient GoogleMaps v2 for Android API, has successfully passed the circuit!
source share