Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple setonInfoWindowClickListener not working
    primarykey
    data
    text
    <p>So these are my two loops in the map and when ever i click the setoninfowindow i only get the first.class in the new screen. say if i click one of the marker it has to go to first.class and if i click on another marker it has to go to the second.class</p> <p><strong>firstloop</strong></p> <pre><code>for (HashMap&lt;String, Object&gt; data : firstLoop) { final String regno = (String) data.get(REG_NO); String dname = (String) data.get(CAR); final String driver_ph = (String) data.get(MOBILE); longt=Float.parseFloat((String) data.get(LONGITUDE)); lat=Float.parseFloat((String) data.get(LATITUDE)); map.addMarker(new MarkerOptions() .position(new LatLng(lat, longt)) .title("title2") .snippet(name) .icon(BitmapDescriptorFactory .fromResource(R.drawable.pin_car))); map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { Intent in=new Intent(getApplicationContext(),second.class); startActivity(in); }}); } </code></pre> <p><strong>secondloop</strong></p> <pre><code>for (HashMap&lt;String, Object&gt; data : secondloop) { String reg = (String) data.get(ID); longt=Float.parseFloat((String) data.get(1_LONGITUDE)); lat=Float.parseFloat((String) data.get(1_LATITUDE)); map.addMarker(new MarkerOptions() .position(new LatLng(lat, longt)) .title("title1") .snippet(reg) .icon(BitmapDescriptorFactory .fromResource(R.drawable.pin_car))); map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { Intent in=new Intent(getApplicationContext(),first.class); in.putExtra("driverid", marker.getSnippet()); startActivity(in); }}); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload