....

2014年7月23日 星期三

[長知識] Android compare previous Location and current Location

The first you need to define two variables

Location newLocation = null;
Location oldLocation = null;



and then, you can call onLocationChange loop to compare newLocation and oldLocation

oldLocation = newLocation;
newLocation = mLocationManager.getLastKnowLocation(LocationManager.GPS_PROVIDER);


so, you can compare them if you need!!!

like
the same and update or the order and update


沒有留言:

張貼留言