Is there a way to manually trigger the code inside a LocationListener‘s onLocationChanged method? It should receive a Location object with the last known location, I guess.
Is there a way to manually trigger the code inside a LocationListener ‘s onLocationChanged
Share
Sure thing, if it’s your
LocationListener–onLocationChanged()is a public method; just call it with whatever Location object you have on hand (maybe have your location listener cache it somewhere, or useLocationManager‘sgetLastKnownLocationmethod to grab the last location seen from a specific provider and callonLocationChanged()with that).