I'm using the LocationClient which works good. Now I'm trying to create mock locations (setMockMode(true) + setMockLocation(mockLoc). But onLocationChanged of my LocationListener isn't called. What can be the problem?
I followed this: http://developer.android.com/training/location/location-testing.html
Steps:
- connect
- requestLocationUpdates
- setMockMode true
- setMockLocation (provider = "flp")
Okay so you gotta update your Locations with
setTime()
andsetElapsedRealtimeNanos()
.A complete create method for a location will look something like following:
This has been tested to work with Nexus 5.