2

I am working on google place API, During this I get any place from google place picker but while fetching my current location from this.

PendingResult<PlaceLikelihoodBuffer> result = Places.PlaceDetectionApi.getCurrentPlace(mGoogleApiClient, null);
                result.setResultCallback(new ResultCallback<PlaceLikelihoodBuffer>() {
                    @Override
                    public void onResult(@NonNull PlaceLikelihoodBuffer  likelyPlaces) {
                        Log.e("result",""+likelyPlaces);
                        for (PlaceLikelihood placeLikelihood : likelyPlaces) {
                            Log.e("result", String.format("Place '%s' has likelihood: %g",
                                    placeLikelihood.getPlace().getName(),
                                    placeLikelihood.getLikelihood()));

                            Toast.makeText(MainActivity.this,"Place "+placeLikelihood.getPlace().getName()+" has likelihood "+placeLikelihood.getLikelihood()+"",Toast.LENGTH_LONG ).show();
                        }
                        likelyPlaces.release();
                    }
                });

PlaceLikelihoodBuffer returning the statusCode error:

PlaceLikelihoodBuffer{status=Status{statusCode=ERROR, resolution=null}, attributions=null}

so I am stuck here from long time, And I didn't find any solution related to this.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.