I want to set OnMarkerClickListener of different Markers. Here I want to print **i variable value of loop** whenever respective marker will get clicked. So I did by following way .. but it is not working , It display same last value **170** of loop on the Snackbar in every different marker click.. But I suppose to get 0,10,20,30....170 respectively in snackbar on different marker click. 

Please help...

```
    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;

        // SETTING MARKER
        for(int i=0;i<180;i=i+10) {
            LatLng sydney = new LatLng(i, i);
            mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Position"+i));

            //ON MARKER CLICK
            final int finalI = i;

            mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {

                @Override
                public boolean onMarkerClick(Marker marker) {
                    Snackbar.make((View) findViewById(R.id.map),""+finalI,Snackbar.LENGTH_LONG).show();
                    return true;
                }
            });
        }
}

```

Here is the marker which was created by loop
but I am getting same value to 170 

[![enter image description here](https://i.stack.imgur.com/W3wHg.png)](https://i.stack.imgur.com/W3wHg.png)