Back to project page GPSDataCollector.
The source code is released under:
GNU General Public License
If you think the Android project GPSDataCollector listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ymelo.gpsdatacollector.app; /*ww w . j a va2s . c o m*/ import android.os.Handler; public class TaskUpdater { private static final int INTERVAL = 1000; private Handler mHandler; private Runnable runnable; public TaskUpdater(final Runnable uiUpdater) { runnable = new Runnable() { @Override public void run() { // Run the passed runnable uiUpdater.run(); // Re-run it after the update interval mHandler.postDelayed(this, INTERVAL); } }; } void startRepeatingTask() { runnable.run(); } void stopRepeatingTask() { mHandler.removeCallbacks(runnable); } }