I have a custom class ArrayList. There are about 10 objects in the list, each of which has elements such as Title, Snippet, LatLng. I successfully added all 10 to the Map using my custom class functions such as getTitle, getSnippet, getLatLng, etc.
Now, when I click on the info window (marker), I want to be able to somehow KNOW which object of my user class this marker corresponds to.
For example, if I click on the McDonald market, I want to know which element from my ArrayList array belongs to this marker.
I looked at MarkerOptions, and there seems to be nothing there that I can use to identify the corresponding custom object.
If the question is too confusing, let me make it simple:
ArrayList<CustomObj> objects = blah map.addMarker(new MarkerOptions().position(new LatLng( Double.parseDouble(result.get(i).getCompanyLatLng() .split(",")[0]), Double.parseDouble(result .get(i).getCompanyLatLng().split(",")[1]))) .title(result.get(i).getCompanyName()) .snippet(result.get(i).getCompanyType()) .icon(BitmapDescriptorFactory .fromResource(R.drawable.pin)));
Now, when clicked, I move on to the next page. The next page should know that the WHICH object was clicked so that I can send other data to this page (for example, the URLs of the images that need to be uploaded, etc.).
How to add a unique integer or any identifier to my marker?