How can I get the current gps location every time a function is called?
问题 What I want to do is to get the location latitude and longitude each time a function is called. As I have understood the best way to do that is to leave the location update for a few seconds to get the correct fix and then disable it, but I can't make it work in my app. What I have managed until now is to get the last known location of the phone, every time the displayData function is called, but I have not been able to get over all the errors that appear when I'm trying to change to