title: How can the autocomplete search fragment be visible on a button onclick only?
body: <p>I have a map activity. i have added a autocomplete search fragment in the map to search places. I want to show the autocomplete fragment only when my search button is clicked. How to do that? I want the given code inside a button click.</p>
  
  <pre><code> placeAutoComplete = (PlaceAutocompleteFragment) getFragmentManager().findFragmentById(R.id.place_autocomplete);
      placeAutoComplete.setOnPlaceSelectedListener(new PlaceSelectionListener() {
          @Override
          public void onPlaceSelected(Place place) {
              addMarker(place);
              //Log.d("Maps", "Place selected: " + place.getName());
          }
  
          @Override
          public void onError(Status status) {
              Log.d("Maps", "An error occurred: " + status);
          }
      });
      // Obtain the SupportMapFragment and get notified when the map is ready to be used.
      SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
              .findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  }
  public void addMarker(Place p){
  
      MarkerOptions markerOptions = new MarkerOptions();
  
      markerOptions.position(p.getLatLng());
      markerOptions.title(p.getName()+"");
      markerOptions.icon(BitmapDescriptorFactory.fromResource(R.mipmap.hosp));
  
      mMap.addMarker(markerOptions);
      mMap.moveCamera(CameraUpdateFactory.newLatLng(p.getLatLng()));
      mMap.animateCamera(CameraUpdateFactory.zoomTo(13));
  
  }
  </code></pre>