@@ -0,0 +1,2014 @@
+/*%0A * Copyright (C) 2011 Alexander Blom%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage net.idlesoft.android.apps.github.ui;%0A%0Aimport android.content.Context;%0Aimport android.support.v4.content.AsyncTaskLoader;%0A%0A/**%0A * Loader which extends AsyncTaskLoaders and handles caveats as pointed out in%0A * http://code.google.com/p/android/issues/detail?id=14944.%0A * %3Cp/%3E%0A * Based on CursorLoader.java in the Fragment compatibility package%0A *%0A * @param %3CD%3E%0A *            data type%0A * @author Alexander Blom (me@alexanderblom.se)%0A */%0Apublic abstract class AsyncLoader%3CD%3E extends AsyncTaskLoader%3CD%3E %7B%0A    private D data;%0A%0A    /**%0A     * Create async loader%0A     *%0A     * @param context%0A     */%0A    public AsyncLoader(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    @Override%0A    public void deliverResult(D data) %7B%0A        if (isReset())%0A            // An async query came in while the loader is stopped%0A            return;%0A%0A        this.data = data;%0A%0A        super.deliverResult(data);%0A    %7D%0A%0A    @Override%0A    protected void onStartLoading() %7B%0A        if (data != null)%0A            deliverResult(data);%0A%0A        if (takeContentChanged() %7C%7C data == null)%0A            forceLoad();%0A    %7D%0A%0A    @Override%0A    protected void onStopLoading() %7B%0A        // Attempt to cancel the current load task if possible.%0A        cancelLoad();%0A    %7D%0A%0A    @Override%0A    protected void onReset() %7B%0A        super.onReset();%0A%0A        // Ensure the loader is stopped%0A        onStopLoading();%0A%0A        data = null;%0A    %7D%0A%7D

Add AsyncLoader class from Alexander Blom