Code example for FragmentActivity

Methods: cancelLoad, getContext

0
        /** 
         * Handles a request to stop the Loader. 
         */ 
        @Override protected void onStopLoading() { 
            // Attempt to cancel the current load task if possible. 
            cancelLoad();
        } 
 
        /** 
         * Handles a request to cancel a load. 
         */ 
        @Override public void onCanceled(List<AppEntry> apps) {
            super.onCanceled(apps);
 
            // At this point we can release the resources associated with 'apps' 
            // if needed. 
            onReleaseResources(apps);
        } 
 
        /** 
         * Handles a request to completely reset the Loader. 
         */ 
        @Override protected void onReset() { 
            super.onReset(); 
 
            // Ensure the loader is stopped 
            onStopLoading(); 
 
            // At this point we can release the resources associated with 'apps' 
            // if needed. 
            if (mApps != null) {
                onReleaseResources(mApps);
                mApps = null;
            } 
 
            // Stop monitoring for changes. 
            if (mPackageObserver != null) {
                getContext().unregisterReceiver(mPackageObserver);
                mPackageObserver = null;
            } 
        } 
 
        /**