title: Unable to add parse image to custom Google Map info window
body: <p>I am trying to add an image I have in parse to a google map info window, I can add the image from resource but I am unable to load my existing parse image to the image view inside my infowindow. I have loaded the image from parse in other areas of my app, but it seems that the info window is out of scope. Is there a way to load this parse image inside my infowindow? I do not want to use a resource file because the images are different in parse. The 2 sections of my code are below:</p>
  
  <pre><code>        class NearbyEventTask extends AsyncTask&lt;String, Void, ArrayList&lt;Item&gt;&gt;
      {
          Random r;
          Context context;
          public NearbyEventTask(Context context){
              r = new Random();
              this.context = context;
          }
          public LatLng getRandomLocation(Location center, double radius) {
              // Convert radius from meters to degrees
              double radiusInDegrees = radius / 111000;
  
              double u = r.nextDouble();
              double v = r.nextDouble();
              double w = radiusInDegrees * Math.sqrt(u);
              double t = 2 * Math.PI * v;
              double lat = w * Math.cos(t);
              double lon = w * Math.sin(t);
  
              double new_lat = lat / Math.cos(center.getLongitude());
              return new LatLng(new_lat + center.getLatitude(), lon + center.getLongitude());
          }
          @Override
          protected ArrayList&lt;Item&gt; doInBackground(String... params) {
              ArrayList&lt;Item&gt; list = new ArrayList&lt;Item&gt;();
              ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("Places");
              if(searchType!=null &amp;&amp; searchType.length()&gt;0) {
                  ArrayList&lt;String&gt; types = new ArrayList&lt;String&gt;();
                  for(String type: searchType.split("\\|")) types.add(type);
                  query.whereContainedIn("category", types);
              }
              if(lastKnownLocation!=null) {
                  query.whereNear("location", new ParseGeoPoint(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()));
              }
              try {
                  List&lt;ParseObject&gt; objects = query.find();
                  for(ParseObject obj : objects){
                      ParseGeoPoint point = obj.getParseGeoPoint("location");
                      Item item = new Item(obj.getString("name"), obj.getString("category"), obj.getString("description"), point.getLatitude(), point.getLongitude());
                      item.vicinity = obj.getString("description") + " | "+obj.getDate("event_date");
                      list.add(item);
                      if(obj.getParseFile("icon")!=null) {
                          item.setIcon(obj.getParseFile("icon").getUrl());
                          item.downloadIcon(context);
                      }
                  }
              } catch (ParseException e) {
              }
              return list;
          }
  
          @Override
          protected void onPostExecute(final ArrayList&lt;Item&gt; arrayList) {
              if(isCancelled()) return;
              if(googleMap!=null) {
                  googleMap.clear();
                  mMarker2Item.clear();
                  LatLngBounds.Builder boundBuilder = new LatLngBounds.Builder();
                  for (Item item : arrayList) {
                      MarkerOptions opts = new MarkerOptions()
                              .position(item.location())
                              .title(item.name);
                      if(item.iconBitmap!=null){
                          opts = opts.icon(BitmapDescriptorFactory.fromBitmap(item.iconBitmap));
                      }
                      Marker newMarker = googleMap.addMarker(opts);
                      newMarker.setSnippet(item.vicinity);
                      mMarker2Item.put(newMarker, item);
                      boundBuilder.include(item.location());
                  }
                  try {
  
  
                      if (firstTime) {
                          firstTime = false;
                          CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngBounds(boundBuilder.build(), 200);
                          googleMap.moveCamera(cameraUpdate);
                          googleMap.animateCamera(cameraUpdate, 1000, null);
                      }
                  } catch (Exception ex) {
  
                  }
              } else mHandler.postDelayed(new Runnable() {
                  @Override
                  public void run() {
                      onPostExecute(arrayList);
                  }
              }, 500);
          }
      }
  
      @Override
      public void onMapReady(final GoogleMap googleMap) {
          googleMap.setMyLocationEnabled(true);
          this.googleMap = googleMap;
          googleMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
  
              // Use default InfoWindow frame
              @Override
              public View getInfoWindow(Marker arg0) {
                  return null;
              }
  
              // Defines the contents of the InfoWindow
              @Override
              public View getInfoContents(Marker marker) {
                  View v = getActivity().getLayoutInflater().inflate(R.layout.maps_infowindow, null);
                  v.setLayoutParams(new LinearLayout.LayoutParams((int) (mapFragment.getView().getMeasuredWidth() * .9), LinearLayout.LayoutParams.WRAP_CONTENT));
                  ((TextView) v.findViewById(R.id.title)).setText(marker.getTitle());
                  ((TextView) v.findViewById(R.id.desc)).setText(marker.getSnippet());
                  ImageView icon = (ImageView) v.findViewById(R.id.imageView5);
                  icon.getLayoutParams().height = 800; // OR
                  icon.getLayoutParams().width = 800;
  
  
                  ArrayList&lt;Item&gt; list = new ArrayList&lt;Item&gt;();
                  ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("Places");
                  if(searchType!=null &amp;&amp; searchType.length()&gt;0) {
                      ArrayList&lt;String&gt; types = new ArrayList&lt;String&gt;();
                      for(String type: searchType.split("\\|")) types.add(type);
                      query.whereContainedIn("icon", types);
                  }
                  try {
                      List&lt;ParseObject&gt; objects = query.find();
  
                      for(ParseObject obj : objects){
                          if(obj.getParseFile("icon")!=null) {
  
                              Picasso.with(getActivity()).load(obj.getParseFile("icon").getUrl()).into(icon, new MarkerCallback(marker));
  
                          }
                      }
                  } catch (ParseException e) {
                  }
                  return v;
  
              }
          }
  
      );
  </code></pre>
  
  <p>CODE UPDATED: If you look at my NearbyEventTast class at the top, you can see how the code was implemented to get the data back from parse. I am trying to do the same thing by creating a new NearbyEventTast but I fail to load the correct image. It always shows the same image (I think its the first one in parse) and displays it for all objects instead of the corresponden image. Any idiea whats going on? Thank you!</p>