I have simple flow: when I click the Button I should get current Latitude/Longitude at that time only,
I am using LocationListner for this but problem is that the method onLocationChange() is calling only when I change the location otherwise gives 0.00/0.00. what shoukd I do please help me.
I have simple flow: when I click the Button I should get current Latitude/Longitude
Share
You cant really ask Android to provide you with the current GPS locations right away your best bet would be wait till it gets a location Changed Update or use the Last Known values !
You can use the last known location.
Have a look here:
What is the simplest and most robust way to get the user's current location on Android?
Hope this helps