android : Display image in imageview from another imageview source? -
i have imageview in app, 1 of imageview parent image,the function of parent image display image imageview child if click.
if image b1 click source image of imageview b1 show in imageview , imageview b can b1 if clicked, how achieve that?
i use code show image in imageview b.
private class custominfowindowadapter implements infowindowadapter{ private view view; public custominfowindowadapter() { view = getlayoutinflater().inflate(r.layout.custom_info_window, null); } @override public view getinfocontents(marker marker) { if (mapv2infowindow.this.marker != null && mapv2infowindow.this.marker.isinfowindowshown()) { mapv2infowindow.this.marker.hideinfowindow(); mapv2infowindow.this.marker.showinfowindow(); } return null; } @override public view getinfowindow(final marker marker) { mapv2infowindow.this.marker = marker; string url = null; if (marker.getid() != null && markers != null && markers.size() > 0) { if ( markers.get(marker.getid()) != null && markers.get(marker.getid()) != null) { url = markers.get(marker.getid()); } } final imageview image = ((imageview) view.findviewbyid(r.id.badge)); 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); getinfocontents(marker); } }); } else { image.setimageresource(r.drawable.ic_launcher); } return view; } }
i error
03-24 15:35:54.099: e/androidruntime(8412): fatal exception: main 03-24 15:35:54.099: e/androidruntime(8412): java.lang.nullpointerexception 03-24 15:35:54.099: e/androidruntime(8412): @ com.ltvie.chatkrawala.mapv2infowindow$1.oninfowindowclick(mapv2infowindow.java:125) 03-24 15:35:54.099: e/androidruntime(8412): @ com.google.android.gms.maps.googlemap$10.e(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ com.google.android.gms.maps.internal.f$a.ontransact(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ android.os.binder.transact(binder.java:279) 03-24 15:35:54.099: e/androidruntime(8412): @ eiy.a(sourcefile:82) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.e.bl.b(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.ay.o.am_(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.ay.o.a(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.ay.bg.b(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.ay.bc.onsingletapconfirmed(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.bo.g.onsingletapconfirmed(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ maps.bo.i.handlemessage(unknown source) 03-24 15:35:54.099: e/androidruntime(8412): @ android.os.handler.dispatchmessage(handler.java:99) 03-24 15:35:54.099: e/androidruntime(8412): @ android.os.looper.loop(looper.java:130) 03-24 15:35:54.099: e/androidruntime(8412): @ android.app.activitythread.main(activitythread.java:3687) 03-24 15:35:54.099: e/androidruntime(8412): @ java.lang.reflect.method.invokenative(native method) 03-24 15:35:54.099: e/androidruntime(8412): @ java.lang.reflect.method.invoke(method.java:507) 03-24 15:35:54.099: e/androidruntime(8412): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:867) 03-24 15:35:54.099: e/androidruntime(8412): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:625) 03-24 15:35:54.099: e/androidruntime(8412): @ dalvik.system.nativestart.main(native method)
thanks.
just this.
imageviewa.setimagedrawable( imageviewb.getdrawable() );
Comments
Post a Comment