title: Updating InfoWindow from Parse Query Google Maps Android
body: <p>I am trying to create a custom infowindow in my app by using the information I get from a Parse query. The problem I am running into is that I can only update the UI from the main thread and not a background process that Parse queries use. </p>
  
  <pre><code>map.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
              @Override
              public View getInfoWindow(Marker marker) {
                  return null;
              }
  
              @Override
              public View getInfoContents(Marker marker) {
                  View v = getLayoutInflater().inflate(R.layout.info_window, null);
                  TextView titleInfoWindow = (TextView) v.findViewById(R.id.titleInfoWindow);
                  final TextView dateInfoWindow = (TextView) v.findViewById(R.id.dateInfoWindow);
                  TextView timeInfoWindow = (TextView) v.findViewById(R.id.timeInfoWindow);
                  TextView latitudeInfoWindow = (TextView) v.findViewById(R.id.latitudeInfoWindow);
                  TextView sexInfoWindow = (TextView) v.findViewById(R.id.sexInfoWindow);
                  TextView speciesInfoWindow = (TextView) v.findViewById(R.id.speciesInfoWindow);
  
                  titleInfoWindow.setText(marker.getTitle());
                  latitudeInfoWindow.setText(String.valueOf(marker.getPosition().latitude));
  
  
                  ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("deletingTest");
                  query.whereEqualTo("shark", marker.getTitle());
                  query.whereEqualTo("latitude", String.valueOf(marker.getPosition().latitude));
                  query.whereEqualTo("longitude", String.valueOf(marker.getPosition().longitude));
                  query.setLimit(100);
                  query.findInBackground(new FindCallback&lt;ParseObject&gt;() {
                      public void done(List&lt;ParseObject&gt; scoreList, ParseException e) {
                          if (scoreList.size() == 0) {
                              Log.d("MainActivity", "0");
                          } else {
                              Log.d("MainActivity", String.valueOf(scoreList.size()));
                              dateInfoWindow.setText("22");
                          }
                      }
                  });
  
  
              return v;
          }
      });
  </code></pre>
  
  <p>So the titleInfoWindow and the latitudeInfoWindow are being updated while dateInfoWindow is not as it is not on the main thread. What would be the best way to be able to update the infoWindow from the data I would get out of the Parse query? </p>
  
  <p>Here is the XML file am using for the infoWindow layout.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="wrap_content"
      android:layout_height="wrap_content"&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/titleInfoWindow" /&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/dateInfoWindow"/&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/timeInfoWindow"/&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/latitudeInfoWindow"/&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/longitudeInfoWindow"/&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/sexInfoWindow"/&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:id="@+id/speciesInfoWindow"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>