I am using this tutorial to create a autocomplete search box. I have created a custom adapter to populate my autocomplete text box.
mGoogleApiClient = new GoogleApiClient.Builder(ActivityMap.this)
.addApi(Places.GEO_DATA_API)
.enableAutoManage(this, GOOGLE_API_CLIENT_ID, this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
PendingResult<AutocompletePredictionBuffer> results =
Places.GeoDataApi.getAutocompletePredictions(mGoogleApiClient,
constraint.toString(),
mBounds, null);
However, I am receiving the following error message as follows:
{statusCode=ERROR_OPERATION_FAILED, resolution=null}
for the following lines of code in the getPredictions method in the Adapter
final Status status = autocompletePredictions.getStatus();
if (!status.isSuccess()) {
Toast.makeText(getContext(), "Error: " + status.toString(),
Toast.LENGTH_SHORT).show();
Log.e(TAG, "Error getting place predictions: " + status.toString());
autocompletePredictions.release();
return null;
}
PS: In the lines:
PendingResult<AutocompletePredictionBuffer> results =
Places.GeoDataApi
.getAutocompletePredictions(mGoogleApiClient, constraint.toString(),
mBounds, mPlaceFilter);
I have tried changing mPlaceFilter to null, to the same result