Back to project page WhatsUp.
The source code is released under:
GNU General Public License
If you think the Android project WhatsUp 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 nu.placebo.whatsup.network; //from ww w . j av a2 s .c o m import nu.placebo.whatsup.android.os.AsyncTask; /** * * Makes it possible to run NetworkOperation in their own thread and then easily * return it to the UI thread. * */ public class NetworkTask<T> extends AsyncTask<NetworkOperation<T>, NetworkOperation<T>> { @Override protected NetworkOperation<T> doInBackground(NetworkOperation<T> o) { o.setOperationResult(o.execute()); return o; } @Override protected void onPostExecute(NetworkOperation<T> o) { o.notifyListeners(o.getResult()); } }