Note that there are some explanatory texts on larger screens.

plurals
  1. POGet Custom class data information on Map V2 PopupClick event in android
    primarykey
    data
    text
    <p>hello friends my java file as below </p> <pre><code>public class MainActivity extends FragmentActivity { GoogleMap googleMap; final int RQS_GooglePlayServices = 1; Double lat; Double lng; Marker marker; LatLng coordinate; private LocationManager locationManager; private String provider; Marker startPerc; AutoCompleteTextView mAutoCompleteTextViewAddress; CommonMethods mCommonMethods; String getsearchingAddress; Geocoder mGeocoder; List&lt;Address&gt; list; int maxResult = 10; String addressList[]; Intent mIntent; public double latitude; public double longitude; private HashMap&lt;String, String&gt; eventMarkerMap; LatLng mLatLng; public static double CurrentLatitude; public static double CurrentLongitude; DatabaseConnectionAPI mDatabaseConnectionAPI; ArrayList&lt;ParserRestaurant&gt; mArrayListRestaurent; ArrayList&lt;ParserBranch&gt; mArrayListBranch; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mCommonMethods = new CommonMethods(); // initilizeMap(); mDatabaseConnectionAPI = new DatabaseConnectionAPI( getApplicationContext()); try { mDatabaseConnectionAPI.createDataBase(); mDatabaseConnectionAPI.openDataBase(); } catch (IOException e) { e.printStackTrace(); } mArrayListBranch = new ArrayList&lt;ParserBranch&gt;(); mArrayListBranch = mDatabaseConnectionAPI.getBranchData(); if (googleMap == null) { googleMap = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); if (googleMap == null) { // Toast.makeText(getApplicationContext(), // "Sorry! unable to create maps", Toast.LENGTH_SHORT).show(); } } for (int i = 0; i &lt; mArrayListBranch.size(); i++) { ParserBranch mBranch=new ParserBranch(); mBranch.setBrId(mArrayListBranch.get(i).getBrId()); LatLng coordinate = new LatLng(Double.parseDouble(mArrayListBranch .get(i).getBrLat()), Double.parseDouble(mArrayListBranch .get(i).getBrLng())); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom( new LatLng(Double.parseDouble(mArrayListBranch.get(i) .getBrLat()), Double.parseDouble(mArrayListBranch .get(i).getBrLng())), 8.0f)); Marker startPerc = googleMap .addMarker(new MarkerOptions() .position(coordinate) .title(mArrayListBranch.get(i).getResName()) .snippet(mArrayListBranch.get(i).getAddress()) .icon(BitmapDescriptorFactory .defaultMarker(BitmapDescriptorFactory.HUE_YELLOW))); eventMarkerMap = new HashMap&lt;String, String&gt;(); System.out.println("fd " + mArrayListBranch.get(i).getBrId()); System.out.println("Marker ID "+startPerc.getId()); eventMarkerMap.put(startPerc.getId(), mArrayListBranch.get(i).getBrId()); } googleMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { String eventInfo = eventMarkerMap.get(marker); System.out.println("ID " + eventInfo); marker.hideInfoWindow(); } }); googleMap.setInfoWindowAdapter(new InfoWindowAdapter() { // Use default InfoWindow frame @Override public View getInfoWindow(Marker marker) { return null; } // Defines the contents of the InfoWindow @Override public View getInfoContents(Marker marker) { // Getting view from the layout file info_window_layout View v = getLayoutInflater().inflate(R.layout.row_map, null); // Getting reference to the TextView to set title TextView note = (TextView) v.findViewById(R.id.txt_name); TextView snip = (TextView) v.findViewById(R.id.txt_snip); note.setText(marker.getTitle()); snip.setText(marker.getSnippet()); // Returning the view containing InfoWindow contents return v; } }); } </code></pre> <p>when i run above code multiple pin is drop onmap but i want to get particular marker information when i click on that marker so i take setOnInfoWindowClickListener for that and print value if particlur marker id but it gave me every time null any idea how can i solve it ?</p>
    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