title: get other values from marker
body: <p>I'm stuck with this problem and I hope someone can lead me to a solution, I have spent 3 days on it until now..</p>
  
  <p><strong>The Problem</strong></p>
  
  <p>I have 2 activities, activity <strong>A</strong> is a listview populated from a JSON list. Activity <strong>B</strong> is Google maps v2 based with the same json list but its on Map not on list.</p>
  
  <p>on activity <strong>A</strong> list there is <code>onItemclicklistener</code> and when I click on it shows another activity and its works fine. no problem here. everything works like is supposed too.</p>
  
  <p>on Activity <strong>B</strong> there is map fragment, and it's filled with lat-lng values from a JSON list too. So there is 10 +markers on map. So when I click on marker, I am getting the name and address and its working fine too.</p>
  
  <p><strong>This what I Want</strong></p>
  
  <p>When I clicking the item on list it taking me to activity <strong>C</strong>. and there are some textviews to show which days the company are open. this step is done, its working fine and everything like it supposed too.</p>
  
  <p>When I click on Map, there are markers, So I have <code>onInfoWindowClick()</code>. It's fine too but how i can get more values from the <code>onInfoWindowClick()</code>? </p>
  
  <p>What i mean is, i can get (getSnippet and getTitle from marker) But I have other values in the list, like name, days, id's. this what i getting is only .getsnippet and getTitle through the marker.</p>
  
  <p>I am very stuck with this issue. 
  I really want to do the same like on the List. When I press on list its getting all values but when iam on Maps i can only get marker window with Title and Snippet. Iam sorry if I couldnt explain good, pls feel free to ask me if there is more code you want too see.</p>
  
  <pre><code>                for (HashMap&lt;String, String&gt; hashMap : contactList) {
              map.addMarker(new MarkerOptions()
                .position(new LatLng(Double.valueOf(hashMap.get(TAG_LAT)) , Double.valueOf(hashMap.get(TAG_LNG))))
                .title(hashMap.get(TAG_ADDRESS))
                .snippet(hashMap.get(TAG_NAME)) );
  </code></pre>
  
  <hr>
  
  <pre><code>@Override
  public void onInfoWindowClick(Marker marker) {
  
      marker.getTitle();
      marker.getSnippet(); 
  }
  </code></pre>
  
  <p><strong>UPDATED CODE</strong></p>
  
  <pre><code>    public class MapBased extends AbstractMapActivity implements OnNavigationListener,OnInfoWindowClickListener
  {
      private static final String TAG_Location = "location_id";
      private static final String TAG_Company = "company_id";
      private static final String TAG_PLACE = "place";
      private static final String TAG_POSTAL = "postal";
      private static final String TAG_CITY = "city";
      private static final String TAG_MONDAY = "monday";
      private static final String TAG_TUESDAY = "tuesday";
      private static final String TAG_WEDNESDAY = "wednesday";
      private static final String TAG_THURSDAY = "thursday";
      private static final String TAG_FRIDAY = "friday";
      private static final String TAG_SATURDAY = "saturday";
      private static final String TAG_SUNDAY = "sunday";
      private static final String TAG_TYPE = "type";
      private static final String TAG_NOCAR = "nocar";
  
      private static final String TAG_NAME = "name";
      private static final String TAG_LAT = "lat";
      private static final String TAG_LNG = "lng";
      private static final String TAG_ADDRESS = "address";
      private static final String TAG = "Debug of Project"; // 
  
       private String a;
  private String b;
  
  private double my_lat;
  private double my_lng;
  
  private static final String STATE_NAV="nav";
  private static final int[] MAP_TYPE_NAMES= { R.string.normal, R.string.hybrid, R.string.satellite, R.string.terrain };
  private static final int[] MAP_TYPES= { GoogleMap.MAP_TYPE_NORMAL, GoogleMap.MAP_TYPE_HYBRID, GoogleMap.MAP_TYPE_SATELLITE,
                                  GoogleMap.MAP_TYPE_TERRAIN };
  private GoogleMap map=null;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      SQLiteDatabase db = openOrCreateDatabase("mydb.db", Context.MODE_PRIVATE, null);
      db.execSQL("CREATE TABLE IF NOT EXISTS gps_kordinater (ID INTEGER PRIMARY KEY AUTOINCREMENT, Latitude REAL, Longitude REAL);");
  
      String query = "SELECT Latitude,Longitude FROM gps_kordinater WHERE Id = (SELECT MAX(Id) FROM gps_kordinater)";
      Cursor cursor = db.rawQuery(query, null);
      if(cursor != null)
      {
      cursor.moveToFirst();
       a = cursor.getString(0);
  
       b = cursor.getString(1);
      }
  
  
     String url = "http://example.com";
  
     my_lat = Double.valueOf(a);  
     my_lng = Double.valueOf(b);
  
  
     db.close();
  
      // now enabled if disabled = ingen support for jb aka 4.0
       if (android.os.Build.VERSION.SDK_INT &gt; 9) {
            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
            StrictMode.setThreadPolicy(policy);
       }
  
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; contactList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      JSONParser jParser = new JSONParser();
      JSONArray json = jParser.getJSONFromUrl(url);
      try {
             for(int i = 0; i &lt; json.length(); i++){
                  JSONObject c = json.getJSONObject(i);
  
                  String lat = c.getString(TAG_LAT);
                  String lng = c.getString(TAG_LNG);
                  String name = c.getString(TAG_NAME);
                  String adresse = c.getString(TAG_ADDRESS);
  
                  String location_id = c.getString(TAG_Location);
                  String company_id = c.getString(TAG_Company);
                  String place = c.getString(TAG_PLACE) ; 
                  String postal = c.getString(TAG_POSTAL);
                  String city = c.getString(TAG_CITY);
                  String monday = c.getString(TAG_MONDAY);
                  if(c.getString(TAG_MONDAY).isEmpty())
                      {
                          monday="Lukket";
                      }
                  else
                      {
                          monday=c.getString(TAG_MONDAY);
                      }
  
                  String tuesday = c.getString(TAG_TUESDAY);
                  if(c.getString(TAG_TUESDAY).isEmpty())
                      {
                          tuesday="Lukket";
                      }
                  else
                      {
                          tuesday=c.getString(TAG_TUESDAY);
                      }
  
                  String wednesday = c.getString(TAG_WEDNESDAY);  
                  if(c.getString(TAG_WEDNESDAY).isEmpty())
                      {
                          wednesday="Lukket";
                      }
                  else
                      {
                          wednesday=c.getString(TAG_WEDNESDAY);
                      }
  
                  String thursday = c.getString(TAG_THURSDAY);
                  if(c.getString(TAG_THURSDAY).isEmpty())
                      {
                          thursday="Lukket";
                      }
                  else
                      {
                          thursday=c.getString(TAG_THURSDAY);
                      }
  
                  String friday = c.getString(TAG_FRIDAY);
                  if(c.getString(TAG_FRIDAY).isEmpty())
                      {
                          friday="Lukket";
                      }
                  else
                      {
                          friday=c.getString(TAG_FRIDAY);
                      }
  
                  String saturday = c.getString(TAG_SATURDAY);
                  if(c.getString(TAG_SATURDAY).isEmpty())
                      {
                          saturday="Lukket";
                      }
                  else
                      {
                          saturday=c.getString(TAG_SATURDAY);
                      }   
  
                  String sunday=c.getString(TAG_SUNDAY);
                  if(c.getString(TAG_SUNDAY).isEmpty())
                      {
                          sunday="Lukket";
                      }
                  else
                      {
                          sunday=c.getString(TAG_SUNDAY);
                      }
  
  
  
                  String nocar = c.getString(TAG_NOCAR);
                  String type = c.getString(TAG_TYPE);
  
  
              // creating new HashMap
              HashMap&lt;String, String&gt; map2 = new HashMap&lt;String, String&gt;();
  
              // adding each child node to HashMap key =&gt; value
  
              map2.put(TAG_LAT, lat);
              map2.put(TAG_LNG, lng);
  
              map2.put(TAG_NAME, name);
              map2.put(TAG_ADDRESS, adresse);
              map2.put(TAG_Location, location_id);
              map2.put(TAG_Company, company_id);
              map2.put(TAG_PLACE, place);
              map2.put(TAG_POSTAL, postal);
              map2.put(TAG_CITY, city);
              map2.put(TAG_MONDAY, monday);
              map2.put(TAG_TUESDAY, tuesday);
              map2.put(TAG_WEDNESDAY, wednesday);
              map2.put(TAG_THURSDAY, thursday);
              map2.put(TAG_FRIDAY, friday);
              map2.put(TAG_SATURDAY, saturday);
              map2.put(TAG_SUNDAY, sunday);
              map2.put(TAG_TYPE, type);
              map2.put(TAG_NOCAR, nocar);
  
              // adding HashList to ArrayList
              contactList.add(map2);
  
               Log.d(TAG, "Hashmap 1: " + map2); 
  
               Log.d(TAG, "Hashmap 2: " + map2.values()); 
               Log.d(TAG, "array 4: " + contactList); 
  
             }
  
  
             Log.d(TAG, "array 5: " + contactList); 
  
      } catch (JSONException e) {
          e.printStackTrace();
          Log.e("JSON Parser", "Error parsing data " + e.toString());
  
      }
  
      if (readyToGo()) {
          setContentView(R.layout.map_based);
  
          SupportMapFragment mapFrag=
                  (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map2);
          initListNav();
  
          map=mapFrag.getMap();
  
          CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(my_lat , my_lng));
  
          CameraUpdate zoom=CameraUpdateFactory.zoomTo(10);
          map.moveCamera(center);
          map.animateCamera(zoom);
  
          for (HashMap&lt;String, String&gt; hashMap : contactList) {
              map.addMarker(new MarkerOptions()
                .position(new LatLng(Double.valueOf(hashMap.get(TAG_LAT)) , Double.valueOf(hashMap.get(TAG_LNG))))
                .title(hashMap.get(TAG_ADDRESS))
                .snippet(hashMap.get(TAG_NAME))
  
                );
          }
  
          map.setInfoWindowAdapter(new PopupMapBasedAdapter(getLayoutInflater()));
          map.setOnInfoWindowClickListener(this);
  
      }
  
       Button btn_web = (Button) findViewById(R.id.footer_list_btn);
          btn_web.setOnClickListener(new View.OnClickListener() {
              @Override
                  public void onClick(View view) {
                  //myVib.vibrate(50);
                  finish();
                  }
              });
  }
  
  @Override
  public boolean onNavigationItemSelected(int itemPosition, long itemId) {
      map.setMapType(MAP_TYPES[itemPosition]);
      return(true);
  }
  
  @Override
  public void onSaveInstanceState(Bundle savedInstanceState) {
      super.onSaveInstanceState(savedInstanceState);
      savedInstanceState.putInt(STATE_NAV,getSupportActionBar().getSelectedNavigationIndex());
  }
  
  @Override
  public void onInfoWindowClick(Marker marker) {
  
      marker.getTitle();
      marker.getSnippet(); 
  }
  
     @Override
      public void onRestoreInstanceState(Bundle savedInstanceState) {
      super.onRestoreInstanceState(savedInstanceState);  
      getSupportActionBar().setSelectedNavigationItem(savedInstanceState.getInt(STATE_NAV));
      }
  
      private void initListNav() {
  ArrayList&lt;String&gt; items=new ArrayList&lt;String&gt;();
  ArrayAdapter&lt;String&gt; nav=null;
  ActionBar bar=getSupportActionBar();
  
      for (int type : MAP_TYPE_NAMES) {
          items.add(getString(type));
      }
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
          nav=
                  new ArrayAdapter&lt;String&gt;(
                          bar.getThemedContext(),
                          android.R.layout.simple_spinner_item,
                          items);
                  }
      else {
          nav=
              new ArrayAdapter&lt;String&gt;( 
                      this,
                     android.R.layout.simple_spinner_item,
                     items);
                  }
  
      nav.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
      bar.setListNavigationCallbacks(nav, this);  
  }
  
  
      }
  </code></pre>