Components/xamandroidsupportv4-18-19.1.0/lib/android/19.1.0/content/support/v4/src/java/android/support/v4/app/LoaderManager.java
@SuppressWarnings("unchecked")
    public <D> Loader<D> restartLoader(int id, Bundle args, LoaderManager.LoaderCallbacks<D> callback) {
        if (mCreatingLoader) {
            throw new IllegalStateException("Called while creating a loader");
        }
        
        LoaderInfo info = mLoaders.get(id);
        if (DEBUG) Log.v(TAG, "restartLoader in " + this + ": args=" + args);
        if (info != null) {
            LoaderInfo inactive = mInactiveLoaders.get(id);
            if (inactive != null) {
                if (info.mHaveData) {
                    // This loader now has data...  we are probably being
                    // called from within onLoadComplete, where we haven't
                    // yet destroyed the last inactive loader.  So just do
                    // that now.
                    if (DEBUG) Log.v(TAG, "  Removing last inactive loader: " + info);
                    inactive.mDeliveredData = false;
                    inactive.destroy();
                    info.mLoader.abandon();
                    mInactiveLoaders.put(id, info);
                } else {
                    // We already have an inactive loader for this ID that we are
                    // waiting for!  What to do, what to do...
                    if (!info.mStarted) {
                        // The current Loader has not been started...  we thus
                        // have no reason to keep it around, so bam, slam,
                        // thank-you-ma'am.
                        if (DEBUG) Log.v(TAG, "  Current loader is stopped; replacing");
                        mLoaders.put(id, null);
                        info.destroy();
                    } else {
                        // Now we have three active loaders... we'll queue
                        // up this request to be processed once one of the other loaders
                        // finishes.
                        if (info.mPendingLoader != null) {
                            if (DEBUG) Log.v(TAG, "  Removing pending loader: " + info.mPendingLoader);
                            info.mPendingLoader.destroy();
                            info.mPendingLoader = null;
                        }
                        if (DEBUG) Log.v(TAG, "  Enqueuing as new pending loader");
                        info.mPendingLoader = createLoader(id, args, 
                                (LoaderManager.LoaderCallbacks<Object>)callback);
                        return (Loader<D>)info.mPendingLoader.mLoader;
                    }
                }
            } else {
                // Keep track of the previous instance of this loader so we can destroy
                // it when the new one completes.
                if (DEBUG) Log.v(TAG, "  Making last loader inactive: " + info);
                info.mLoader.abandon();
                mInactiveLoaders.put(id, info);
            }
        }
        
        info = createAndInstallLoader(id, args,  (LoaderManager.LoaderCallbacks<Object>)callback);
        return (Loader<D>)info.mLoader;
    }
/**
     * Call to re-create the Loader associated with a particular ID.  If there
     * is currently a Loader associated with this ID, it will be
     * canceled/stopped/destroyed as appropriate.  A new Loader with the given
     * arguments will be created and its data delivered to you once available.
     * 
     * <p>This function does some throttling of Loaders.  If too many Loaders
     * have been created for the given ID but not yet generated their data,
     * new calls to this function will create and return a new Loader but not
     * actually start it until some previous loaders have completed.
     * 
     * <p>After calling this function, any previous Loaders associated with
     * this ID will be considered invalid, and you will receive no further
     * data updates from them.
     * 
     * @param id A unique (to this LoaderManager instance) identifier under
     * which to manage the new Loader.
     * @param args Optional arguments that will be propagated to
     * {@link LoaderCallbacks#onCreateLoader(int, Bundle) LoaderCallbacks.onCreateLoader()}.
     * @param callback Interface implementing management of this Loader.  Required.
     * Its onCreateLoader() method will be called while inside of the function to
     * instantiate the Loader object.
     */
Call to re-create the Loader associated with a particular ID.  If there
is currently a Loader associated with this ID, it will be
canceled/stopped/destroyed as appropriate.  A new Loader with the given
arguments will be created and its data delivered to you once available.

This function does some throttling of Loaders.  If too many Loaders
have been created for the given ID but not yet generated their data,
new calls to this function will create and return a new Loader but not
actually start it until some previous loaders have completed.

After calling this function, any previous Loaders associated with
this ID will be considered invalid, and you will receive no further
data updates from them.

@param id A unique (to this LoaderManager instance) identifier under
which to manage the new Loader.
Call to re - create the Loader associated with a particular ID . If there is currently a Loader associated with this ID it will be canceled / stopped / destroyed as appropriate . A new Loader with the given arguments will be created and its data delivered to you once available . This function does some throttling of Loaders . If too many Loaders have been created for the given ID but not yet generated their data new calls to this function will create and return a new Loader but not actually start it until some previous loaders have completed . After calling this function any previous Loaders associated with this ID will be considered invalid and you will receive no further data updates from them . @param id A unique ( to this LoaderManager instance ) identifier under which to manage the new Loader .
@SuppressWarnings("unchecked")
    public <D> Loader<D> restartLoader(int id, Bundle args, LoaderManager.LoaderCallbacks<D> callback) {
        if (mCreatingLoader) {
            throw new IllegalStateException("Called while creating a loader");
        }
        LoaderInfo info = mLoaders.get(id);
        if (DEBUG) Log.v(TAG, "restartLoader in " + this + ": args=" + args);
        if (info != null) {
            LoaderInfo inactive = mInactiveLoaders.get(id);
            if (inactive != null) {
                if (info.mHaveData) {
                    if (DEBUG) Log.v(TAG, "  Removing last inactive loader: " + info);
                    inactive.mDeliveredData = false;
                    inactive.destroy();
                    info.mLoader.abandon();
                    mInactiveLoaders.put(id, info);
                } else {
                    if (!info.mStarted) {
                        if (DEBUG) Log.v(TAG, "  Current loader is stopped; replacing");
                        mLoaders.put(id, null);
                        info.destroy();
                    } else {
                        if (info.mPendingLoader != null) {
                            if (DEBUG) Log.v(TAG, "  Removing pending loader: " + info.mPendingLoader);
                            info.mPendingLoader.destroy();
                            info.mPendingLoader = null;
                        }
                        if (DEBUG) Log.v(TAG, "  Enqueuing as new pending loader");
                        info.mPendingLoader = createLoader(id, args, 
                                (LoaderManager.LoaderCallbacks<Object>)callback);
                        return (Loader<D>)info.mPendingLoader.mLoader;
                    }
                }
            } else {
                if (DEBUG) Log.v(TAG, "  Making last loader inactive: " + info);
                info.mLoader.abandon();
                mInactiveLoaders.put(id, info);
            }
        }
        info = createAndInstallLoader(id, args,  (LoaderManager.LoaderCallbacks<Object>)callback);
        return (Loader<D>)info.mLoader;
    }
@ SuppressWarnings ( "unchecked" ) public < D > Loader < D > restartLoader ( int id , Bundle args , LoaderManager . LoaderCallbacks < D > callback ) { if ( mCreatingLoader ) { throw new IllegalStateException ( "Called while creating a loader" ) ; } LoaderInfo info = mLoaders . get ( id ) ; if ( DEBUG ) Log . v ( TAG , "restartLoader in " + this + ": args=" + args ) ; if ( info != null ) { LoaderInfo inactive = mInactiveLoaders . get ( id ) ; if ( inactive != null ) { if ( info . mHaveData ) { if ( DEBUG ) Log . v ( TAG , "  Removing last inactive loader: " + info ) ; inactive . mDeliveredData = false ; inactive . destroy ( ) ; info . mLoader . abandon ( ) ; mInactiveLoaders . put ( id , info ) ; } else { if ( ! info . mStarted ) { if ( DEBUG ) Log . v ( TAG , "  Current loader is stopped; replacing" ) ; mLoaders . put ( id , null ) ; info . destroy ( ) ; } else { if ( info . mPendingLoader != null ) { if ( DEBUG ) Log . v ( TAG , "  Removing pending loader: " + info . mPendingLoader ) ; info . mPendingLoader . destroy ( ) ; info . mPendingLoader = null ; } if ( DEBUG ) Log . v ( TAG , "  Enqueuing as new pending loader" ) ; info . mPendingLoader = createLoader ( id , args , ( LoaderManager . LoaderCallbacks < Object > ) callback ) ; return ( Loader < D > ) info . mPendingLoader . mLoader ; } } } else { if ( DEBUG ) Log . v ( TAG , "  Making last loader inactive: " + info ) ; info . mLoader . abandon ( ) ; mInactiveLoaders . put ( id , info ) ; } } info = createAndInstallLoader ( id , args , ( LoaderManager . LoaderCallbacks < Object > ) callback ) ; return ( Loader < D > ) info . mLoader ; }
Call to re-create the Loader associated with a particular ID.
Call to re - create the Loader associated with a particular ID .
// This loader now has data...  we are probably being // called from within onLoadComplete, where we haven't // yet destroyed the last inactive loader.  So just do // that now. // We already have an inactive loader for this ID that we are // waiting for!  What to do, what to do... // The current Loader has not been started...  we thus // have no reason to keep it around, so bam, slam, // thank-you-ma'am. // Now we have three active loaders... we'll queue // up this request to be processed once one of the other loaders // finishes. // Keep track of the previous instance of this loader so we can destroy // it when the new one completes.