Android Open Source - GPSDataCollector Task Updater






From Project

Back to project page GPSDataCollector.

License

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.

Java Source Code

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);
  }
}




Java Source Code List

com.ymelo.gpsdatacollector.app.ApplicationTest.java
com.ymelo.gpsdatacollector.app.Config.java
com.ymelo.gpsdatacollector.app.DisplayFragment.java
com.ymelo.gpsdatacollector.app.GetAddressTask.java
com.ymelo.gpsdatacollector.app.LocationServiceErrorMessages.java
com.ymelo.gpsdatacollector.app.MainActivity.java
com.ymelo.gpsdatacollector.app.MapFragment.java
com.ymelo.gpsdatacollector.app.NavigationDrawerFragment.java
com.ymelo.gpsdatacollector.app.RecordFragment.java
com.ymelo.gpsdatacollector.app.TaskUpdater.java
com.ymelo.gpsdatacollector.app.TripListFragment.java
com.ymelo.gpsdatacollector.app.utils.FileUtils.java
com.ymelo.gpsdatacollector.app.utils.FragmentFix.java
com.ymelo.gpsdatacollector.app.utils.LocationUtils.java