private class EarthquakeAsyncTask extends AsyncTask<String, Void, List<Earthquake>>{ ... }
https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&eventtype=earthquake&orderby=time&minmag=6&limit=10
Loader
https://developer.android.com/guide/components/loaders.html?utm_source=udacity&utm_medium=course&utm_campaign=android_basics
Loader manager
https://developer.android.com/reference/android/app/LoaderManager.html?utm_source=udacity&utm_medium=course&utm_campaign=android_basics
Loader callback
https://developer.android.com/reference/android/app/LoaderManager.LoaderCallbacks.html?utm_source=udacity&utm_medium=course&utm_campaign=android_basics
package com.example.android.quakereport; import android.content.AsyncTaskLoader; import android.content.Context; import java.util.List; public class EarthquakeLoader extends AsyncTaskLoader<List<Earthquake>>{ private static final String LOG_TAG = EarthquakeLoader.class.getName(); private String mUrl; public EarthquakeLoader(Context context, String url){ super(context); mUrl = url; } @Override protected void onStartLoading(){ forceLoad(); } @Override public List<Earthquake> loadInBackground(){ if (mUrl == null){ return null; } List<Earthquake> earthquakes = QueryUtils.fetchEarthquakeData(mUrl); return earthquakes; } }