Timeout for a response to a change in the Geocoder class for Android.

I am developing an application that relies on the Internet to get location information. Everything works fine, except that sometimes the Internet is slow and the Geocoder class waits before sending the results.

Geocoder geocoder = new Geocoder(mContext, Locale.getDefault());

I tried to explore geocoding methods, but there is no timeout there. How can i fix this?


PS: addresses = geocoder.getFromLocation(lat, lon, 1);located inside asynctask doInBackground ().

Thank.

+4
source share

All Articles