Open alxsfrm opened 7 years ago
I also have this behaviour with getPlacesByQuery.
Funny is that just like you your code, I create a singleton instance of Google Places.
When I create a Google Places instance with each call, it works well even after three call. I guess something is not well closed (or closed somehow after the second call ?)
Found it !
In the file DefaultRequestHandler.java:58, the connection is not closed.
We could have used response.getEntity().getContent()
which automatically closes the connection, but its deprecated, though we can use EntityUtils.consume(response.entity)
after the line to close it.
I created my own version of RequestHandler
with this line, gave it to new GooglePlaces(API_KEY, MyRequestHandler())
and everything works as expected.
Unfortunately, I don't have time to create a PR right now, but here's the solution !
Hi, I'm trying to use your library in my project and encounters in following issue: i can't run the function getNearbyPlacesRankedByDistance more then two times. Here is my function:
On the third run i'm running my function, the function getNearbyPlacesRankedByDistance does not returns and seems to be blocked. After the function execution i don't get anything neither in the log, nor in debug. What am i doing wrong ?
Regards, Alex.