Back to project page mobile-connector-sdk-android.
The source code is released under:
Apache License
If you think the Android project mobile-connector-sdk-android 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.silverpop.engage.util; //from w w w .ja va2s .c o m import android.os.*; /** * Created by jeremydyer on 6/4/14. */ public abstract class TimedAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> { private long expirationTimestamp = -1; public void setExpiresInSeconds(long expirationSeconds) { expirationTimestamp = System.currentTimeMillis() + (expirationSeconds * 1000); } public boolean isExpired() { if (expirationTimestamp > 0) { if (System.currentTimeMillis() >= expirationTimestamp) { return true; } } return false; } protected abstract Result doInBackground(Params... objects); }