title: Android google maps add to marker own tag
body: <p>I have such code:</p>
  
  <pre><code>protected void onPostExecute(final ArrayList&lt;HashMap&lt;String, String&gt;&gt; adapter) {
  
                  for (final HashMap&lt;String, String&gt; a : adapter) {
                      LatLng pos = new LatLng(Double.valueOf(a.get(TAG_latitude)), Double.valueOf(a.get(TAG_longitude)));
                      Log.e("pppppos", String.valueOf(pos.latitude));
                      Marker m = map.addMarker(new MarkerOptions().position(pos)
                              .title(a.get(TAG_NAME))
                              .snippet("Kiel is cool"));
  
                      map.setOnInfoWindowClickListener(
                                new OnInfoWindowClickListener(){
                                      public void onInfoWindowClick(Marker marker){
                                        Intent nextScreen = new Intent(SearchExchangerActivity.this, BankExchangersListActivity.class);
                                          nextScreen.putExtra("exchanger_id", id);    
                                          startActivityForResult(nextScreen, 0);
                                      }
                                    });
                  }
  </code></pre>
  
  <p>But i need to set invisible to user field for example <code>Tag_id</code> for each marker, and use this id then when sending extra info to other activity, something like:</p>
  
  <pre><code>protected void onPostExecute(final ArrayList&lt;HashMap&lt;String, String&gt;&gt; adapter) {
  
              for (final HashMap&lt;String, String&gt; a : adapter) {
                  LatLng pos = new LatLng(Double.valueOf(a.get(TAG_latitude)), Double.valueOf(a.get(TAG_longitude)));
                  Marker m = map.addMarker(new MarkerOptions().position(pos)
                          .title(a.get(TAG_NAME))
                          .snippet("Kiel is cool")
                                                      .Tag_id(TAG_ID));
  
                  map.setOnInfoWindowClickListener(
                            new OnInfoWindowClickListener(){
                                  public void onInfoWindowClick(Marker marker){
                                    Intent nextScreen = new Intent(SearchExchangerActivity.this, BankExchangersListActivity.class);
                                      nextScreen.putExtra("exchanger_id", marker.get(TAG_ID));    
                                      startActivityForResult(nextScreen, 0);
                                  }
                                });
              }
  </code></pre>
  
  <p>Is it real to do? Just how can i in my listener get what marker i'm clicking?</p>
  
  <p>Also it could be done via title field... But i'm getting error's when writing <code>marker.getTitle()</code>...</p>
  
  <p><strong>upd</strong></p>
  
  <pre><code>for (final HashMap&lt;String, String&gt; a : adapter) {
                  LatLng pos = new LatLng(Double.valueOf(a.get(TAG_latitude)), Double.valueOf(a.get(TAG_longitude)));
                  Log.e("pppppos", String.valueOf(pos.latitude));
                  HashMap&lt;Marker, String&gt; m = new HashMap&lt;Marker, String&gt;();
                          m.put( map.addMarker(new MarkerOptions().position(pos)
                          .title(a.get(TAG_NAME))
                          .snippet("Kiel is cool")), "1");                    
  
              }
  
              map.setOnInfoWindowClickListener(
                new OnInfoWindowClickListener(){
                      public void onInfoWindowClick(HashMap&lt;Marker, String&gt; marker){
                        Intent nextScreen = new Intent(SearchExchangerActivity.this, BankExchangersListActivity.class);
                          nextScreen.putExtra("exchanger_id", "1");   
                          startActivityForResult(nextScreen, 0);
                      }
                    });
  </code></pre>