How do i pass an object on Google maps Marker? so that when i click I can pass the data on the new activity? Is this possible or any way how to do it?

Sample Code

 mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {
            LogUtil.d("onMarkerClick");
            MyMarkerObj obj = getMyMarkerObj (); 
            mListView.setSelection(obj.id);
            return false;
        }
    });

    mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
        @Override
        public void onInfoWindowClick(Marker marker) {
            MyMarkerObj obj = getMyMarkerObj (); 
            intent.putExtra("MyMarkerJson" , gson.ToJson(obj));
            startActivity(intent);
        }
    });

Related posts

Recent Viewed