Thank you so much :)
To get most accurate user position everytime user presses a button, follow these steps:
- Go to https://github.com/mumayank/AirLocation#usage (See section Usage), and as written there, do the following:
- Declare airLocation in your activity
- Override onActivityResult and call airLocation.onActivityResult inside it
- Override onRequestPermissionsResult and call airLocation.onRequestPermissionsResult inside it
Now whenever you need the most accurate user position, simply re-initialize airLocation variable as shown in the example in the library’s Github page. In onSuccess of the callback, you will get a location object. Use this to retrieve lat and long of that location, along with other params.