title: PlaceAutoCompleteFragment in android not showing suggestions and closes after entering the first letter
body: <p>The  autocomplete widget service in the <code>Google Places API</code> for Android is not working as expected. I have included the fragment in my xml page and also added the listener activity to my <code>onCreate()</code>. <br>Then I start executing the autocomplete fragment, I click the first letter of the word I want to search and suddenly instead of showing suggestions the <code>onError()</code> gets executed and it closes.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&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.akhil.maplocation.MapsActivity" /&gt;
      &lt;fragment
          android:id="@+id/place_autocomplete_fragment"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
          /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The mainactivity for this is: </p>
  
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
      LatLng fromadd;
       @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_maps);
             PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
                      getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
  
  
              autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {
                  @Override
                  public void onPlaceSelected(Place place) {
                      // TODO: Get info about the selected place.
                      fromadd = place.getLatLng();
                      double lat = fromadd.latitude;
                      double lng = fromadd.longitude;        
                      gotoLocation(lat, lng, 15);
                  }
  
                  @Override
                  public void onError(Status status) {
                      // TODO: Handle the error.
                      Toast.makeText(getBaseContext(),"failure",Toast.LENGTH_LONG).show();
                  }
              });
  mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
              @Override
              public void onMapClick(LatLng latLng) {
                  MarkerOptions markerOptions = new MarkerOptions();
                  markerOptions.position(latLng);
                  fromadd = latLng;
                  markerOptions.title(latLng.latitude + ":" + latLng.longitude + " " + latLng.toString());
                  mMap.clear();
                  mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));
                  mMap.addMarker(markerOptions);
              }
          });
  
  
          mapFragment.getMapAsync(this);
  }
  
  @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
  
          if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {                
              return;
          }
          mMap.setMyLocationEnabled(true);
  </code></pre>
  
  <p>}</p>