how can i Create looper in timer
Posted
by
Yogesh Ude
on Stack Overflow
See other posts from Stack Overflow
or by Yogesh Ude
Published on 2013-10-19T09:50:38Z
Indexed on
2013/10/19
9:53 UTC
Read the original article
Hit count: 152
android
private static final long UPDATE_INTERVAL = 1* 60 * 1000; private Timer timer = new Timer(); public int onStartCommand(Intent intent, int flags, int startId) {
timer.scheduleAtFixedRate(new TimerTask()
{
mLocationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, LOCATION_INTERVAL, LOCATION_DISTANCE,
mLocationListeners[0]);
}, 0, UPDATE_INTERVAL);
return START_STICKY;
}
© Stack Overflow or respective owner