Back to project page geocamTalkForAndroid.
The source code is released under:
NASA OPEN SOURCE AGREEMENT VERSION 1.3 THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN COMPUTER SOFTWARE ORI...
If you think the Android project geocamTalkForAndroid 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 gov.nasa.arc.geocam.talk.service; //from w ww . j av a 2s . c om import android.os.Handler; import com.google.inject.Inject; /** * The Class GeoCamSynchronizationTimerTask. */ public class GeoCamSynchronizationTimerTask implements IGeoCamSynchronizationTimerTask { /** The intent helper. */ private IIntentHelper intentHelper; /** The handler. */ private Handler handler = new Handler(); /** The period. */ private long period = 60 * 10 * 1000; // 10 minutes TODO make shared preference /** * Instantiates a new geo cam synchronization timer task. * * @param intentHelper the intent helper */ @Inject public GeoCamSynchronizationTimerTask(IIntentHelper intentHelper) { this.intentHelper = intentHelper; this.handler.postDelayed(this, period); this.handler.post(this); } /* (non-Javadoc) * @see java.lang.Runnable#run() */ @Override public void run() { this.intentHelper.Synchronize(); this.handler.postDelayed(this, period); } /* (non-Javadoc) * @see gov.nasa.arc.geocam.talk.service.IGeoCamSynchronizationTimerTask#resetTimer() */ @Override public void resetTimer() { this.handler.removeCallbacks(this); this.handler.postDelayed(this, period); } /* (non-Javadoc) * @see gov.nasa.arc.geocam.talk.service.IGeoCamSynchronizationTimerTask#stopTimer() */ @Override public void stopTimer() { this.handler.removeCallbacks(this); } }