title: android : Display image in imageview from another imageview source?
body: <p>I have some imageView in my app, one of imageview is parent image,the function of parent image is display image from another imageview child if was click.</p>
  
  <p><img src="https://i.stack.imgur.com/wewZp.png" alt="enter image description here"></p>
  
  <p>If image B1 click then source image of ImageView B1 show in imageView A and another imageView B can do like B1 if clicked, how I achieve that?</p>
  
  <p>i Use this code to show image in imageview B.</p>
  
  <pre><code>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
                      &amp;&amp; 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 &amp;&amp; markers != null &amp;&amp; markers.size() &gt; 0) {
                  if ( markers.get(marker.getId()) != null &amp;&amp;
                          markers.get(marker.getId()) != null) {
                      url = markers.get(marker.getId());
                  }
              }
              final ImageView image = ((ImageView) view.findViewById(R.id.badge));
  
              if (url != null &amp;&amp; !url.equalsIgnoreCase("null")
                      &amp;&amp; !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;
          }
  }
  </code></pre>
  
  <p>I get error</p>
  
  <pre><code>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):     at com.ltvie.chatkrawala.MapV2InfoWindow$1.onInfoWindowClick(MapV2InfoWindow.java:125)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at com.google.android.gms.maps.GoogleMap$10.e(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at com.google.android.gms.maps.internal.f$a.onTransact(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at android.os.Binder.transact(Binder.java:279)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at eiy.a(SourceFile:82)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.e.bl.b(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.ay.o.am_(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.ay.o.a(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.ay.bg.b(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.ay.bc.onSingleTapConfirmed(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.bo.g.onSingleTapConfirmed(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at maps.bo.i.handleMessage(Unknown Source)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at android.os.Handler.dispatchMessage(Handler.java:99)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at android.os.Looper.loop(Looper.java:130)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at android.app.ActivityThread.main(ActivityThread.java:3687)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at java.lang.reflect.Method.invokeNative(Native Method)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at java.lang.reflect.Method.invoke(Method.java:507)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
  03-24 15:35:54.099: E/AndroidRuntime(8412):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>thanks.</p>