Pracuję nad nowym API Google Map v2.Android GoogleMap 2 aktualizuje informacje dynamicznie w InfoWindow z ImageView poprzez Universal Image loader
Użyłem ImageLoader do dynamicznego wyświetlania obrazów w Markerze.
Ale problem jest, gdy mam OnLoadingComplete() Universal Image Loader, ImageView nie jest unieważniany ani automatycznie ani ręcznie.
Następnym razem, gdy kliknę na ten sam znacznik, obraz zostanie wyświetlony z pamięci podręcznej programu Universal Image Loader.
Poniżej jest moje CustomInfoWindowAdapter kod:
private class CustomInfoWindowAdapter implements InfoWindowAdapter {
@Override
public View getInfoContents(Marker marker) {
return null;
}
@Override
public View getInfoWindow(Marker marker) {
final View mWindow = getLayoutInflater().inflate(R.layout.custom_info_window, null);
render(marker, mWindow);
return mWindow;
}
private void render(final Marker marker, View view) {
final String url = markers.get(marker.getId()).getStrProfilePic();
final ImageView image = ((ImageView) view.findViewById(R.id.badge));
Log.e(TAG, "URL : " + url);
if (url != null && !url.equalsIgnoreCase("null")
&& !url.equalsIgnoreCase("")) {
imageLoader.displayImage(url, image, options, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view,
Bitmap loadedImage) {
super.onLoadingComplete(imageUri, view, loadedImage);
((ImageView) view).invalidate();
}
});
} else {
image.setImageResource(R.drawable.noimage);
}
final String title = marker.getTitle();
final TextView titleUi = ((TextView) view.findViewById(R.id.title));
if (title != null) {
titleUi.setText(title);
} else {
titleUi.setText("");
}
final String snippet = marker.getSnippet();
final TextView snippetUi = ((TextView) view.findViewById(R.id.snippet));
if (snippet != null) {
snippetUi.setText(snippet);
} else {
snippetUi.setText("");
}
}
}
ja sklepach Marker IDS w HashTable kiedy dodać znacznik. I od nich otrzymam adres URL zdjęcia.
opcji Pokaż? Konfiguracja? Czy nazywasz 'displayImage (...)' na wątku UI? – NOSTRA
W renderowaniu (końcowy znacznik znacznika, widok widoku) nazwałem metodę imageLoader.displayImage (....). –