Example usage for android.content Loader startLoading

List of usage examples for android.content Loader startLoading

Introduction

In this page you can find the example usage for android.content Loader startLoading.

Prototype

public final void startLoading() 

Source Link

Document

This function will normally be called for you automatically by android.app.LoaderManager when the associated fragment/activity is being started.

Usage

From source file:com.github.secondsun.catfactsdemo.networking.LoaderBasedFactFetcher.java

@Override
public void onResume() {
    Loader<Object> localLoader = activity.getLoaderManager().getLoader(LOADER_ID);
    if (localLoader != null && !localLoader.isStarted()) {
        localLoader.startLoading();
    }/*from w  ww  .  j a  v a  2  s  .  c  o  m*/
    if (localLoader != null) {
        activity.displayFacts(
                ((HttpCatLoader) (Loader<?>) activity.getLoaderManager().getLoader(LOADER_ID)).data);
    }
}

From source file:com.github.secondsun.catfactsdemo.networking.LoaderBasedFactFetcher.java

@Override
public void load(CatFacts activity) {

    final Loader<List<String>> localLoader = activity.getLoaderManager()
            .initLoader(LoaderBasedFactFetcher.LOADER_ID, Bundle.EMPTY, this);
    localLoader.startLoading();

}