Code example for AsyncTaskLoader

class RepairListLoader extends AsyncTaskLoader<ArrayList<String>> {
	private ArrayList<String> mData;
	private BotBrewApp mApplication;
	public RepairListLoader(Context ctx) {
		mApplication = (BotBrewApp)ctx.getApplicationContext();
	public void onStartLoading() { 
		if(mData != null) deliverResult(mData);	// deliver loaded data
		else forceLoad(); // start AsyncTask
	public void deliverResult(ArrayList<String> data) {
		mData = data;		// cache that stuff
		if(isStarted()) super.deliverResult(mData);	// deliver if loader wasn't stopped or canceled
	public void onReset() { 
Experience pair programming with AI  Get Codota for Java