Code example for FragmentActivity

Methods: setProgressBarIndeterminateVisibility

0
 
    @Override 
    public Loader<T> onCreateLoader(int id, Bundle args) {
        FragmentActivity fragmentActivity = activityWeakReference.get();
        if (fragmentActivity != null) {
            fragmentActivity.setProgressBarIndeterminateVisibility(true);
        } 
        return wrappedCallbacks.onCreateLoader(id, args);
    } 
 
    @Override 
    public void onLoadFinished(Loader<T> loader, T data) {
        FragmentActivity fragmentActivity = activityWeakReference.get();
        if (fragmentActivity != null) {
            LoaderManager loaderManager = fragmentActivity.getSupportLoaderManager();
            if (loaderManager != null && !loaderManager.hasRunningLoaders()) {
                fragmentActivity.setProgressBarIndeterminateVisibility(false);
            } 
        } 
        wrappedCallbacks.onLoadFinished(loader, data);
    }