Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/199.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我想在android中点击nextactivity中的标记时发送json数据_Android - Fatal编程技术网

我想在android中点击nextactivity中的标记时发送json数据

我想在android中点击nextactivity中的标记时发送json数据,android,Android,我是新来的,在nextactivity中,我正在努力通过点击标记发送数据,请帮助我。任何帮助都将不胜感激 public class CompanyOutletFragment extends Fragment implements ConnectionCallbacks, OnConnectionFailedListener,LocationListener { private ProgressDialog progressDialog; private GoogleMap g

我是新来的,在nextactivity中,我正在努力通过点击标记发送数据,请帮助我。任何帮助都将不胜感激

public class CompanyOutletFragment extends Fragment implements ConnectionCallbacks, OnConnectionFailedListener,LocationListener {

    private ProgressDialog progressDialog;
    private GoogleMap googleMap;

    private Location mCurrentLocation;
    private LocationRequest locationRequest;
    private int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;

    private GoogleApiClient googleApiClient;

    float latitude1, longitude1;


    String latitude,longitude;

    Geocoder geocoder;
    List<Address> addresses;


    String mobileNumber,contactPerson,id;

    JSONObject datavalues;

    HashMap<String,String> outlet;//in this i am putting key- value pair

    ArrayList<HashMap<String,String>> add1;//here i am adding all the values

    HashMap<String, HashMap> extraMarkerInfo=new  HashMap<String, HashMap>();//here i am getting id relted to laatitude and longitude

    //

    private Marker marker;

    public static final String TAG_CONTACTPERSON = "contactPerson";

    public static final String TAG_LATITUDE= "latitude";

    public static final String TAG_LONGITUDE = "longitude";

    public static final String TAG_ID = "id";


    String companyurl = "http://client.zoneonedigital.com/carwash_v2/api/ws/controller/?access=true&action=get_franchise_list&sHavingCompanyOwnedOutlet=1";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        View rootView = null;
        if (rootView == null) {
            rootView = inflater.inflate(R.layout.fragment_companyoutlet, container, false);
        }
        initilizeMap(rootView);



        getCompanyList();


        getLocation(rootView);
        return rootView;
    }

    private void getCompanyList() {
        //  showdialouge();
        RequestQueue requestQueue = Volley.newRequestQueue(getActivity());
        CustomRequest jsonrequest = new CustomRequest(companyurl, null, this.reponseSuccessListener(), this.errorListener());
        requestQueue.add(jsonrequest);

        // TODO Auto-generated method stub

    }

    private Response.ErrorListener errorListener() {
        // TODO Auto-generated method stub
        return new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError error) {
                // TODO Auto-generated method stub
                //   dissmissdialouge();

            }
        };
    }


    private void getNearbyLocation(View v, String latitude1, String longitude1) {
        HashMap<String, String> params = new HashMap<>();
        params.put("latitude", String.valueOf(latitude1));
        params.put("longitude", String.valueOf(longitude1));
        RequestQueue requestQueue = Volley.newRequestQueue(getActivity());
        CustomRequest jsonRequest = new CustomRequest(Request.Method.POST, Config.URL_GET_NEEARBY_FRENCHISE_LIST, params,
                this.createNearSuccessListner(), this.errorNearListner());
        requestQueue.add(jsonRequest);
    }

    private Response.Listener<JSONObject> createNearSuccessListner() {
        return new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                Log.d("location", response.toString());
                try {
                    if (response.getBoolean("status") == true) {

                    } else {
                        Toast.makeText(getActivity(), response.toString(), Toast.LENGTH_SHORT).show();
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }

            }
        };
    }

    private Response.ErrorListener errorNearListner() {
        return new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                Toast.makeText(getActivity(), volleyError.getMessage(), Toast.LENGTH_SHORT).show();
            }
        };
    }


    private Response.Listener<JSONObject> reponseSuccessListener() {
        // TODO Auto-generated method stub
        return new Response.Listener<JSONObject>() {

            @Override
            public void onResponse(JSONObject response) {
                // TODO Auto-generated method stub
                //    dissmissdialouge();
                Log.d("frenchosilist", response.toString());
                try {
                    if (response.getBoolean("status")) {
                        JSONArray data = response.getJSONArray("data");

                        add1=new ArrayList<HashMap<String,String>>();

                     outlet = new HashMap<String,String>();

                        if (data.length() > 0) {
                            for (int i = 0; i < data.length(); i++) {
                                 datavalues = data.getJSONObject(i);
                                FrenchiseModel fm = new FrenchiseModel();
                                // fm.setFrenchiseID(Integer.valueOf(datavalues.getString("id")));
                                fm.setFrenchiseName(datavalues.getString("franchiseName"));

                                fm.setContactPerson(datavalues.getString("contactPerson"));

                                fm.setMobileNumber(datavalues.getString("mobileNumber"));

                                fm.setFrenchiseLang(datavalues.getString("latitude"));

                                fm.setFrenchiseLat(datavalues.getString("longitude"));



                                latitude1 = Float.valueOf(datavalues.getString("latitude"));

                                longitude1 = Float.valueOf(datavalues.getString("longitude"));

                                latitude = datavalues.getString("latitude");

                                longitude = datavalues.getString("longitude");

                                id=datavalues.getString("id");

                                System.out.println("All id's Are"+ id);

                                contactPerson=datavalues.getString("contactPerson");

                                System.out.println("Contact Person Are"+ contactPerson);

                               mobileNumber=datavalues.getString("mobileNumber");

                                System.out.println("Contact Mobile Are"+  mobileNumber);

                                fm.setFrenchiseLat(datavalues.getString("latitude"));
                                fm.setFrenchiseLang(datavalues.getString("longitude"));

                                outlet.put(TAG_LONGITUDE,longitude);

                                outlet.put(TAG_LATITUDE,latitude);

                                outlet.put(TAG_ID,id);

                                outlet.put(TAG_CONTACTPERSON,contactPerson);

                                add1.add(outlet);

                                System.out.println("total values Are"+add1);

                                if (googleMap != null)
                                    googleMap.addMarker(new MarkerOptions().position(new LatLng(Double.valueOf(datavalues.getString("latitude")), Double.valueOf(datavalues.getString("longitude")))).title(datavalues.getString("franchiseName")).draggable(true).icon(BitmapDescriptorFactory.fromResource(R.drawable.car_map)));
                            }


                        }
                    }
                } catch (JSONException e) {
                    // TODO Auto-generated catch block
                    //   dissmissdialouge();
                    e.printStackTrace();
                }

            }
        };
    }

    private void getLocation(View rootView) {
        // TODO Auto-generated method stub
        if (googleApiClient == null) {
            googleApiClient = new GoogleApiClient.Builder(getActivity()).addApi(LocationServices.API)
                    .addConnectionCallbacks(this).addOnConnectionFailedListener(this).build();
            googleApiClient.connect();

            LocationRequest locationRequest = LocationRequest.create();
            locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
            locationRequest.setInterval(30 * 1000);
            locationRequest.setFastestInterval(5 * 1000);
            LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
                    .addLocationRequest(locationRequest);

            // **************************
            builder.setAlwaysShow(true); // this is the key ingredient
            // **************************

            PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi
                    .checkLocationSettings(googleApiClient, builder.build());
            result.setResultCallback(new ResultCallback<LocationSettingsResult>() {
                @Override
                public void onResult(LocationSettingsResult result) {
                    final Status status = result.getStatus();
                    final LocationSettingsStates state = result.getLocationSettingsStates();
                    switch (status.getStatusCode()) {
                        case LocationSettingsStatusCodes.SUCCESS:
                            // All location settings are satisfied. The client can
                            // initialize location
                            // requests here.

                            break;
                        case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
                            // Location settings are not satisfied. But could be
                            // fixed by showing the user
                            // a dialog.
                            try {
                                // Show the dialog by calling
                                // startResolutionForResult(),
                                // and check the result in onActivityResult().
                                status.startResolutionForResult(getActivity(), 1000);
                            } catch (IntentSender.SendIntentException e) {
                                // Ignore the error.
                            }
                            break;
                        case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
                            // Location settings are not satisfied. However, we have
                            // no way to fix the
                            // settings so we won't show the dialog.
                            break;
                    }
                }
            });
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.d("location", "onStart fired ..............");
        googleApiClient.connect();
    }

    @Override
    public void onStop() {
        super.onStop();
        Log.d("location", "onStop fired ..............");
        googleApiClient.disconnect();
        Log.d("location", "isConnected ...............: " + googleApiClient.isConnected());
    }

    private void initilizeMap(View rootView) {
        if (googleMap == null) {

            try {
                googleMap = getMapFragment().getMap();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            // check if map is created successfully or not
            if (googleMap == null) {
                Toast.makeText(getContext(), "Sorry! unable to create maps", Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(getContext(), "MAP IS STARTED", Toast.LENGTH_SHORT).show();


                //final LatLng PERTH = new LatLng(-31.90, 115.86);




                if (mCurrentLocation != null) {




                    for (HashMap<String, String> hashMap : add1) {

                        Marker marker=googleMap.addMarker(new MarkerOptions().position(new LatLng(Double.valueOf(hashMap.get(latitude)), Double.valueOf(hashMap.get(longitude)))));

                        getNearbyLocation(rootView, String.valueOf(hashMap.get(latitude)), String.valueOf(hashMap.get(longitude)));



                        Log.d("latitude", String.valueOf(hashMap.get(latitude)));
                        Log.d("langitude", String.valueOf(hashMap.get(longitude)));

                        HashMap<String, String> data = new HashMap<String, String>();

                        data.put("contactPerson",hashMap.get(contactPerson));

                        data.put("mobilenumber",hashMap.get(mobileNumber));

                        extraMarkerInfo.put(marker.getId(),data);

                        System.out.println("Extrainfo id are"+ marker.getId()+"and data are"+data);

                    }

               //     Log.d("latitude", String.valueOf(mCurrentLocation.getLatitude()));
                //    Log.d("langitude", String.valueOf(mCurrentLocation.getLongitude()));
                 //   googleMap.addMarker(new MarkerOptions().position(new LatLng(Double.valueOf(mCurrentLocation.getLatitude()), Double.valueOf(mCurrentLocation.getLongitude()))).draggable(true).icon(BitmapDescriptorFactory.fromResource(R.drawable.car_map)));

                  //  googleMap.addMarker(new MarkerOptions().position( ))

                //    getNearbyLocation(rootView, String.valueOf(mCurrentLocation.getLatitude()), String.valueOf(mCurrentLocation.getLongitude()));





                  //  data.put("contactperson",hashMap.get(TAG_Location));
                 //   data.put(TAG_Company,hashMap.get(TAG_Company));




                }


                //  googleMap.addMarker(new MarkerOptions().position(PERTH).draggable(true).icon(BitmapDescriptorFactory.fromResource(R.drawable.car_map)));
                //  CameraPosition cameraPosition = new CameraPosition.Builder().target(PERTH).zoom(12).build();

                //  googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
            }

            googleMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
                @Override
                public void onInfoWindowClick(Marker marker) {

                     String title = marker.getTitle();

                    HashMap<String, String> marker_data = extraMarkerInfo.get(marker.getId());


                    System.out.println("Marker all values are"+marker_data);

                    String contactperson = marker_data.get(TAG_CONTACTPERSON);

                    System.out.println("Marker contact person values are"+  contactperson);

                    System.out.println("Marker name is"+ title);

                    if(marker.getTitle().equals(title)){
                        Intent intent1 = new Intent(getContext(), Booking.class);
                        intent1.putExtra("contactPerson", contactperson);
                        startActivity(intent1);

                    }


                }
            });

        }

    }

    private SupportMapFragment getMapFragment() {
        // TODO Auto-generated method stub
        FragmentManager fm = null;

        Log.d("tag", "sdk: " + Build.VERSION.SDK_INT);
        Log.d("tag", "release: " + Build.VERSION.RELEASE);

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
            Log.d("tag", "using getFragmentManager");
            fm = getFragmentManager();
        } else {
            Log.d("Fragmenttype", "using getChildFragmentManager");
            fm = getChildFragmentManager();
        }

        return (SupportMapFragment) fm.findFragmentById(R.id.companymapmap);
    }

    @Override
    public void onConnectionFailed(ConnectionResult arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onConnected(Bundle arg0) {
        // TODO Auto-generated method stub
        Log.d("location", "onConnected - isConnected ...............: " + googleApiClient.isConnected());
        displaylocation();

    //startLocationUpdates();

    }

    protected void startLocationUpdates() {
        // TODO Auto-generated method stub
        LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);
    }
    protected void stoplocationupdates() {
        LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, this);
    }

    @Override
    public void onConnectionSuspended(int arg0) {
        // TODO Auto-generated method stub
        googleApiClient.connect();
    }

    @Override
    public void onLocationChanged(Location location) {
        // TODO Auto-generated method stub
        mCurrentLocation = location;
        displaylocation();

    }
    private void displaylocation() {
        mCurrentLocation = LocationServices.FusedLocationApi.getLastLocation(
                googleApiClient);
        if (mCurrentLocation != null) {
            Log.d("latitude",String.valueOf(mCurrentLocation.getLatitude()));
            Log.d("langitude",String.valueOf(mCurrentLocation.getLongitude()));

           googleMap.addMarker(new MarkerOptions().position(new LatLng(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude())).draggable(true).title("Manish"));
            CameraPosition cameraPosition = new CameraPosition.Builder().target(new LatLng(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude())).zoom(12).build();

            googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

            getAddressfromlocation(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude());

        }



        dissmissdialouge();
    }
    protected synchronized void bulidgoogleapiclient() {
        googleApiClient = new GoogleApiClient.Builder(getActivity()).addApi(LocationServices.API)
                .addConnectionCallbacks(this).addOnConnectionFailedListener(this).build();
        googleApiClient.connect();
    }
    protected void createlocationrequest() {
        locationRequest = LocationRequest.create();
        locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
        locationRequest.setInterval(30 * 1000);
        locationRequest.setFastestInterval(5 * 1000);
        locationRequest.setSmallestDisplacement(10);

    }

    private boolean checkplayservices()
    {
        int resultcode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity());
        if(resultcode != ConnectionResult.SUCCESS)
        {
            if(GooglePlayServicesUtil.isUserRecoverableError(resultcode))
            {
                GooglePlayServicesUtil.getErrorDialog(resultcode, getActivity(), PLAY_SERVICES_RESOLUTION_REQUEST).show();
            }
            else
            {
                Toast.makeText(getActivity(), "This is not supported to use google play services", Toast.LENGTH_SHORT).show();

            }

            return false;
        }
        return true;

    }
    private void showdialouge() {
        progressDialog = new ProgressDialog(getActivity());
        progressDialog.setMessage("WAIT...");
        progressDialog.setCancelable(false);
        progressDialog.show();
    }
    private void dissmissdialouge() {
        if(progressDialog != null)
        {
            progressDialog.dismiss();
        }
    }
    protected void getAddressfromlocation(double lat, double lang) {
        geocoder = new Geocoder(getActivity(), Locale.getDefault());

        try {
            addresses = geocoder.getFromLocation(lat, lang, 1);

            String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()
            String city = addresses.get(0).getLocality();
            String state = addresses.get(0).getAdminArea();
            String country = addresses.get(0).getCountryName();
            String postalCode = addresses.get(0).getPostalCode();
            String knownName = addresses.get(0).getFeatureName();
            Log.d("address", address);
          //  this.address.setText(address);
          //  this.address.setTextSize(16);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            dissmissdialouge();
            e.printStackTrace();
        } // Here 1 represent max location result to returned, by documents it recommended 1 to 5

    }

}
公共类CompanyOutletFragment扩展片段实现ConnectionCallbacks、OnConnectionFailedListener、LocationListener{
私有进程对话;
私人谷歌地图谷歌地图;
私有位置mCurrentLocation;
私人位置请求位置请求;
专用int播放服务分辨率请求=1000;
私人GoogleapClient GoogleapClient;
浮动纬度1,纵向纬度1;
弦纬度、经度;
地理编码器;
列出地址;
字符串mobileNumber,contactPerson,id;
JSONObject数据值;
HashMap outlet;//在这里,我放置了键值对
ArrayList add1;//我在这里添加所有的值
HashMap extraMarkerInfo=new HashMap();//这里我得到了与纬度和经度相关的id
//
专用标记;
公共静态最终字符串标记\u CONTACTPERSON=“CONTACTPERSON”;
公共静态最终字符串标记_LATITUDE=“LATITUDE”;
公共静态最终字符串标记_longide=“longide”;
公共静态最终字符串标记\u ID=“ID”;
字符串companyurl=”http://client.zoneonedigital.com/carwash_v2/api/ws/controller/?access=true&action=get_franchise_list&sHavingCompanyOwnedOutlet=1";
@凌驾
创建时的公共void(Bundle savedInstanceState){
//TODO自动生成的方法存根
super.onCreate(savedInstanceState);
}
@凌驾
CreateView上的公共视图(布局、充气机、视图组容器、捆绑包保存状态){
//TODO自动生成的方法存根
视图rootView=null;
if(rootView==null){
rootView=充气机。充气(R.layout.fragment\u companylet,container,false);
}
initilizeMap(rootView);
getCompanyList();
获取位置(rootView);
返回rootView;
}
私有void getCompanyList(){
//showdialouge();
RequestQueue RequestQueue=Volley.newRequestQueue(getActivity());
CustomRequest jsonrequest=新的CustomRequest(companyurl,null,this.reponSuccessListener(),this.errorListener());
add(jsonrequest);
//TODO自动生成的方法存根
}
private Response.ErrorListener ErrorListener(){
//TODO自动生成的方法存根
返回新的响应。ErrorListener(){
@凌驾
公共无效onErrorResponse(截击错误){
//TODO自动生成的方法存根
//disdisdisalouge();
}
};
}
私有void getNearbyLocation(视图v,字符串纬度1,字符串长度1){
HashMap params=新的HashMap();
参数put(“纬度”,String.valueOf(latitude1));
参数put(“经度”,String.valueOf(longitude1));
RequestQueue RequestQueue=Volley.newRequestQueue(getActivity());
CustomRequest jsonRequest=new CustomRequest(Request.Method.POST,Config.URL\u GET\u NEEARBY\u FRENCHISE\u LIST,params,
this.createNearSuccessListner(),this.errorNearListner());
add(jsonRequest);
}
私有响应。侦听器createNearSuccessListner(){
返回新的Response.Listener(){
@凌驾
公共void onResponse(JSONObject响应){
Log.d(“location”,response.toString());
试一试{
if(response.getBoolean(“status”)==true){
}否则{
Toast.makeText(getActivity(),response.toString(),Toast.LENGTH_SHORT).show();
}
}捕获(JSONException e){
e、 printStackTrace();
}
}
};
}
private Response.ErrorListener errorNearListner(){
返回新的响应。ErrorListener(){
@凌驾
公共错误响应(截击错误截击错误){
Toast.makeText(getActivity(),volleyError.getMessage(),Toast.LENGTH_SHORT).show();
}
};
}
private Response.Listener responseSuccessListener()的{
//TODO自动生成的方法存根
返回新的Response.Listener(){
@凌驾
公共void onResponse(JSONObject响应){
//TODO自动生成的方法存根
//disdisdisalouge();
Log.d(“frenchosilist”,response.toString());
试一试{
if(response.getBoolean(“status”)){
JSONArray data=response.getJSONArray(“数据”);
add1=新的ArrayList();
outlet=新的HashMap();
if(data.length()>0){
对于(int i=0;iprivate void initilizeMap(View rootView) {

    if (googleMap == null) {

        try {
            googleMap = getMapFragment().getMap();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        // check if map is created successfully or not
        if (googleMap == null) {
            Toast.makeText(getContext(), "Sorry! unable to create maps", Toast.LENGTH_SHORT).show();
        } else {
            Toast.makeText(getContext(), "MAP IS STARTED", Toast.LENGTH_SHORT).show();
            //final LatLng PERTH = new LatLng(-31.90, 115.86)
            if (mCurrentLocation != null) {

                for (HashMap<String, String> hashMap : add1) {

                    Marker marker=googleMap.addMarker(new MarkerOptions().position(new LatLng(Double.valueOf(hashMap.get(latitude)), Double.valueOf(hashMap.get(longitude)))));
                    getNearbyLocation(rootView, String.valueOf(hashMap.get(latitude)), String.valueOf(hashMap.get(longitude)));
                    Log.d("latitude", String.valueOf(hashMap.get(latitude)));
                    Log.d("langitude", String.valueOf(hashMap.get(longitude)));
                    HashMap<String, String> data = new HashMap<String, String>();
                    data.put("contactPerson",hashMap.get(contactPerson));
                    data.put("mobilenumber",hashMap.get(mobileNumber));
                    extraMarkerInfo.put(marker.getId(),data);
                    System.out.println("Extrainfo id are"+ marker.getId()+"and data are"+data);

                }

               //     Log.d("latitude", String.valueOf(mCurrentLocation.getLatitude()));
               //    Log.d("langitude", String.valueOf(mCurrentLocation.getLongitude()));
               //   googleMap.addMarker(new MarkerOptions().position(new LatLng(Double.valueOf(mCurrentLocation.getLatitude()), Double.valueOf(mCurrentLocation.getLongitude()))).draggable(true).icon(BitmapDescriptorFactory.fromResource(R.drawable.car_map)));
               //  googleMap.addMarker(new MarkerOptions().position( ))
               //    getNearbyLocation(rootView, String.valueOf(mCurrentLocation.getLatitude()), String.valueOf(mCurrentLocation.getLongitude()));
               //  data.put("contactperson",hashMap.get(TAG_Location));
              //   data.put(TAG_Company,hashMap.get(TAG_Company));
            }


            //  googleMap.addMarker(new MarkerOptions().position(PERTH).draggable(true).icon(BitmapDescriptorFactory.fromResource(R.drawable.car_map)));
            //  CameraPosition cameraPosition = new CameraPosition.Builder().target(PERTH).zoom(12).build();
            //  googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        }

        googleMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
            @Override
            public void onInfoWindowClick(Marker marker) {

                 String title = marker.getTitle();

                HashMap<String, String> marker_data = extraMarkerInfo.get(marker.getId());


                System.out.println("Marker all values are"+marker_data);

                String contactperson = marker_data.get(TAG_CONTACTPERSON);

                System.out.println("Marker contact person values are"+  contactperson);

                System.out.println("Marker name is"+ title);

                if(marker.getTitle().equals(title)){
                    Intent intent1 = new Intent(getContext(), Booking.class);
                    intent1.putExtra("contactPerson", contactperson);
                    startActivity(intent1);

                }


            }
        });

    }

}