title: More than just Title and Snippet in a Marker Custom InfoWindow
body: <p>I plot markers according to lat and lon that I receive from a web API through a JSON response.</p>
  
  <p>The problem is that every marker has its own data set, for example each marker has an ID, code, phone number, and name. I would like to show all if this data in each Marker's InfoWindow using a custom InfoWindowAdapter, but I am unable to show relevant data that was received in the JSON.</p>
  
  <p>Here is what I have tried so far. In this code, all marker snippet contain same data, and I want to add different data into this snippet for each Marker: </p>
  
  <pre><code> private class GetFixture extends AsyncTask&lt;Void, Void, Void&gt; {
  
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
      }
  
      @Override
      protected Void doInBackground(Void... arg) {
  
  
          ServiceHandler serviceClient = new ServiceHandler();
          Log.d("url: ", "&gt; " + URL_ITEMS);
          String json = serviceClient.makeServiceCall(URL_ITEMS, ServiceHandler.GET);
          // print the json response in the log
          Log.d("Get match fixture resps", "&gt; " + json);
          if (json != null) {
              try {
                  Log.d("try", "in the try");
                  JSONArray jsonArray = new JSONArray(json);
                  Log.d("jsonObject", "new json Object");
                  // Getting JSON Array node
                  for (int i = 0; i &lt;= jsonArray.length(); i++) {
  
                      JSONObject c = jsonArray.getJSONObject(i);
                      Double matchId = Double.parseDouble(c.getString(TAG_MATCHID));
                      Log.d("matchId", String.valueOf(matchId));
                      Double teamA = Double.valueOf(c.getString(TAG_TEAMA));
                      Log.d("teamA", String.valueOf(teamA));
                       teamB = c.getString(TAG_TEAMB);
                      Log.d("teamB", teamB);
                      //  hashmap for single match
  
                      HashMap&lt;String, String&gt; matchFixture = new HashMap&lt;String, String&gt;();
                      HashMap&lt;String, String&gt; cc = new HashMap&lt;String, String&gt;();
  
                      // adding each child node to HashMap key =&gt; value
                      matchFixture.put(TAG_MATCHID, String.valueOf(matchId));
                      matchFixture.put(TAG_TEAMA, String.valueOf(teamA));
                      areahash.put(TAG_TEAMB, teamB);
  
                      matchFixtureList.add(new LatLng(matchId, teamA));
                      cc.put(TAG_TEAMB,teamB);
                      area.add(teamB);
                  }
              } catch (JSONException e) {
                  Log.d("catch", "in the catch");
                  e.printStackTrace();
              }
          } else {
              Log.e("JSON Data", "Didn't receive any data from server!");
          }
          return null;
      }
  
  
      @Override
      protected void onPostExecute(Void result) {
  
          int x;
          //for (LatLng point : matchFixtureList) {
          //for (String a:area)
          for ( i = 0; i &lt; matchFixtureList.size(); i++) {
  
              mMap.addMarker(new MarkerOptions().position(matchFixtureList.get(i)).title(area.get(i)));
              mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(matchFixtureList.get(i), 15));
              mMap.animateCamera(CameraUpdateFactory.zoomIn());
  
  
  
              // Zoom out to zoom level 10, animating with a duration of 2 seconds.
              mMap.animateCamera(CameraUpdateFactory.zoomTo(15), 2000, null);
              if (mMap != null) {
                  mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
                      @Override
                      public View getInfoWindow(Marker marker) {
                          return null;
                      }
  
                      @Override
                      public View getInfoContents(Marker marker) {
                          View v = getLayoutInflater().inflate(R.layout.check, null);
                          TextView ashid = (TextView) v.findViewById(R.id.ash_id);
                          TextView ashcode = (TextView) v.findViewById(R.id.ash_code);
                          TextView Cellno = (TextView) v.findViewById(R.id.cell_id);
                          TextView Ashname = (TextView) v.findViewById(R.id.ash_name);
  
                          TextView NIC = (TextView) v.findViewById(R.id.nic_id);
                          TextView tvlat = (TextView) v.findViewById(R.id.lat_id);
                          TextView tvLng = (TextView) v.findViewById(R.id.lonti_id);
                          TextView Zmid = (TextView) v.findViewById(R.id.ZM_id);
  
  
  
  
                          LatLng ll = marker.getPosition();
                          ashid.setText(marker.getTitle());
                          tvlat.setText(""+ll.latitude);
                          tvLng.setText("" + ll.longitude);
  
                          Zmid.setText("" + ll.longitude);
                          NIC.setText(""+ll.latitude);
                          Ashname.setText("" + ll.longitude);
                          Cellno.setText(""+ll.latitude);
                          ashid.setText("" + ll.longitude);
                          ashcode.setText(teamB);
  
                          ashcode.setText(marker.getSnippet());
  
                          return v;
                      }
                  });
  
  
              }
  
              // mMap.addMarker(new MarkerOptions().position(pakistan).title("Marker in pakistn"));
              //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
              // mMap.animateCamera(CameraUpdateFactory.zoomIn());
              // Zoom out to zoom level 10, animating with a duration of 2 seconds.
              // mMap.animateCamera(CameraUpdateFactory.zoomTo(15), 2000, null);
              //mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(matchFixtureList(i)));
              //mMap.animateCamera(CameraUpdateFactory.zoomTo(5));
  
  
          }
      }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/60znX.png" rel="nofollow">image of snippet </a></p>