Example usage for android.support.v4.content Loader forceLoad

List of usage examples for android.support.v4.content Loader forceLoad

Introduction

In this page you can find the example usage for android.support.v4.content Loader forceLoad.

Prototype

public void forceLoad() 

Source Link

Document

Force an asynchronous load.

Usage

From source file:org.rm3l.ddwrt.tiles.DDWRTTile.java

/**
 * Instantiate and return a new Loader for the given ID.
 *
 * @param id   The ID whose loader is to be created.
 * @param args Any arguments supplied by the caller.
 * @return Return a new Loader instance that is ready to start loading.
 */// www .ja v a  2 s  . c  om
@Override
@Nullable
public final Loader<T> onCreateLoader(int id, Bundle args) {
    final Loader<T> loader = this.getLoader(id, args);
    if (loader != null) {
        loader.forceLoad();
    }
    return loader;
}

From source file:it.geosolutions.android.map.fragment.sources.SourcesFragment.java

@Override
public Loader<List<LayerStore>> onCreateLoader(int arg0, Bundle arg1) {
    Loader<List<LayerStore>> l = new LayerStoreLoader(getSherlockActivity(), this);
    l.forceLoad();
    return l;/* ww w.  j  a v a  2  s. co  m*/
}

From source file:at.bitfire.davdroid.syncadapter.QueryServerDialogFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Light);
    setCancelable(false);/*from   ww w  .  j  av  a2 s .  c o m*/

    Loader<ServerInfo> loader = getLoaderManager().initLoader(0, getArguments(), this);
    if (savedInstanceState == null) // http://code.google.com/p/android/issues/detail?id=14944
        loader.forceLoad();
}

From source file:can.yrt.onebusaway.SearchResponse.java

private void search() {
    UIHelp.showProgress(this, true);
    Loader<?> loader = getLoaderManager().restartLoader(0, getArguments(), this);
    //loader.onContentChanged();
    loader.forceLoad();
}

From source file:it.geosolutions.android.map.fragment.sources.SourcesFragment.java

/**
 * reloadStores and clean Contextual Action Bar if present
 *///w  w  w  .  j  a v  a2 s  .co m
public void reloadStores() {
    Log.v("SOURCES", "reloading sources");
    Loader l = getSherlockActivity().getSupportLoaderManager().getLoader(LOADER_INDEX);
    if (l != null) {
        adapter.clear();
        l.forceLoad();
    }
    if (actionMode != null) {
        actionMode.finish();
        selected = new ArrayList<LayerStore>();
        getListView().clearChoices();
        getListView().clearFocus();
    }
}

From source file:org.onebusaway.android.ui.SearchResponse.java

private void search() {
    UIUtils.showProgress(this, true);
    Loader<?> loader = getLoaderManager().restartLoader(0, getArguments(), this);
    //loader.onContentChanged();
    loader.forceLoad();
}

From source file:ru.besttuts.stockwidget.ui.SearchableQuoteActivity.java

@Override
protected void onResume() {
    super.onResume();
    LOGD(TAG, "onResume: currentThread = " + Thread.currentThread());
    Loader loader = getSupportLoaderManager().getLoader(URL_LOADER);
    if (null != loader) {
        LOGD(TAG, "Loader is " + loader);
        loader.forceLoad();
    }/*  w  w w.  j  a v a  2  s  . c om*/
}

From source file:org.uab.deic.uabdroid.adapters.ExpandableMaterialsAdapter.java

@Override
protected Cursor getChildrenCursor(Cursor _groupCursor) {
    Loader<Cursor> loader = mLoaderManager.getLoader(1);

    if (loader == null) {
        Bundle arguments = new Bundle();
        arguments.putInt(CHILD_POSITION_KEY, _groupCursor.getPosition());

        mLoadersCounter++;// w w  w.j  a  v a 2 s.  co  m
        mLoaderManager.initLoader(mLoadersCounter, arguments, new MaterialsAdapterCallback());
    } else {
        loader.forceLoad();
    }

    return null;
}

From source file:info.guardianproject.gpg.KeyListFragment.java

@Override
public Loader<KeyserverResult<List<KeyInfo>>> onCreateLoader(int id, Bundle args) {
    Loader<KeyserverResult<List<KeyInfo>>> loader = new KeyserverLoader(getActivity());
    // the AsyncTaskLoader won't start without this here
    loader.forceLoad();
    return loader;
}

From source file:net.naonedbus.fragment.CustomInfiniteListFragement.java

@Override
public Loader<AsyncResult<ListAdapter>> onCreateLoader(final int arg0, final Bundle bundle) {
    final Loader<AsyncResult<ListAdapter>> loader = new AsyncTaskLoader<AsyncResult<ListAdapter>>(
            getActivity()) {/*from ww w .j  a  v a  2s. c  om*/
        @Override
        public AsyncResult<ListAdapter> loadInBackground() {
            return loadContent(getActivity(), bundle);
        }
    };

    if (getListAdapter() == null || getListAdapter().getCount() == 0)
        showLoader();
    loader.forceLoad();

    return loader;
}