title: Not able to use PlaceAutoCompleteFragment in MapsActivity
body: <p>I am new in Android App Development. I am trying to use PlaceAutoCompleteFragment on top of my Maps Activity and I am using this link <a href="https://stackoverflow.com/questions/45107806/autocomplete-search-bar-in-google-maps">AutoComplete Search bar in Google Maps</a></p>
  
  <p>All works fine but as soon as I click on the search box, keyboard appears for a second and then it disappears and focus is lost from the search box.
  So I am not able to type and search.
  Please help.</p>
  
  <p><strong>Below is my java code.</strong></p>
  
  <pre><code>import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  import android.util.Log;
  import com.google.android.gms.common.api.Status;
  import com.google.android.gms.location.places.Place;
  import com.google.android.gms.location.places.ui.PlaceAutocompleteFragment;
  import com.google.android.gms.location.places.ui.PlaceSelectionListener;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  
  public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
      PlaceAutocompleteFragment placeAutoComplete;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
  
          placeAutoComplete = (PlaceAutocompleteFragment)getFragmentManager().findFragmentById(R.id.place_autocomplete);
          placeAutoComplete.setOnPlaceSelectedListener(new PlaceSelectionListener() {
              @Override
              public void onPlaceSelected(Place place) {
                  Log.d("Maps", "Place selected: " + place.getName());
              }
  
              @Override
              public void onError(Status status) {
                  Log.d("Maps", "An error occurred: " + status);
              }
          });
  
          SupportMapFragment mapFragment = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
      }
  
      @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
      }
  }
  </code></pre>
  
  <p><strong>Here is xml code</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MapsActivity"
  android:orientation="vertical"
  android:weightSum="1"&gt;
  
      &lt;fragment
          android:id="@+id/place_autocomplete"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"/&gt;
  
      &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:map="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:id="@+id/map"
          android:name="com.google.android.gms.maps.SupportMapFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context="com.example.manzer.serachtextviewmap.MapsActivity" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>