NOTE: Internet services are OFF intentionally in my phone.
Getting error at the below line:
addresses = geocoder.getFromLocation(latitude, longitude, 1)
I don't want my application to crash even if the internet service is off and want the issue to be caught in catch block. I have implemented the try/catch block, but still my app crashed by giving the below exception:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
is there any solution for my problem. Thanks in advance.
You should call Geocoder on a separate thread
Retrieve address: