Back to project page spots.
The source code is released under:
MIT License
If you think the Android project spots 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.dcc.matc89.spots.network; /*from w w w. j av a 2 s . com*/ import java.util.List; import android.annotation.TargetApi; import android.os.AsyncTask; import android.os.Build; import com.dcc.matc89.spots.model.Sport; @TargetApi(Build.VERSION_CODES.HONEYCOMB) public class FetchSports { public FetchSports() { } public void getSports(OnSportsReceiver receiver) { fetchSports(receiver, null); } private void fetchSports(OnSportsReceiver receiver, String[] params) { if(receiver == null) return; FetchSportsAsyncTask task = new FetchSportsAsyncTask(receiver); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params); else task.execute(params); } public interface OnSportsReceiver{ void onSportsReceived(List<Sport> sports); } }