Android examples for Map:Location
is Location Expired
//package com.java2s; import android.location.Location; public class Main { private int mLocationExpiry = 0; public static boolean isLocationExpired(Location location, int locationExpiryMinutes) { if (location != null && locationExpiryMinutes > 0) { long diff = System.currentTimeMillis() - location.getTime(); return (diff > (locationExpiryMinutes * 60 * 1000)); }/*from www . j a va 2s. co m*/ return false; } public boolean isLocationExpired(Location location) { return isLocationExpired(location, mLocationExpiry); } }