Example usage for android.support.v4.content AsyncTaskLoader setUpdateThrottle

List of usage examples for android.support.v4.content AsyncTaskLoader setUpdateThrottle

Introduction

In this page you can find the example usage for android.support.v4.content AsyncTaskLoader setUpdateThrottle.

Prototype

public void setUpdateThrottle(long delayMS) 

Source Link

Document

Set amount to throttle updates by.

Usage

From source file:com.github.riotopsys.malforandroid2.fragment.MangaListFragment.java

@Override
public Loader<List<BaseRecord>> onCreateLoader(int id, Bundle args) {
    AsyncTaskLoader<List<BaseRecord>> loader = new MangaLoader(getActivity(),
            (MangaReadStatus) getArguments().getSerializable("filter"));
    loader.setUpdateThrottle(1000 / 24);
    return loader;
}

From source file:com.github.riotopsys.malforandroid2.fragment.AnimeListFragment.java

@Override
public Loader<List<BaseRecord>> onCreateLoader(int id, Bundle args) {
    AsyncTaskLoader<List<BaseRecord>> loader = new AnimeLoader(getActivity(),
            (AnimeWatchedStatus) getArguments().getSerializable("filter"));
    loader.setUpdateThrottle(1000 / 24);
    return loader;
}

From source file:de.grobox.liberario.ui.LocationView.java

@Override
public AsyncTaskLoader onCreateLoader(int id, Bundle args) {
    AsyncTaskLoader loader = new AsyncTaskLoader<List<Location>>(getContext()) {
        @Override//from  ww w  . jav a 2  s  .  co  m
        public List<Location> loadInBackground() {
            String search = getText();
            if (search.length() < LocationAdapter.THRESHOLD)
                return null;

            NetworkProvider np = NetworkProviderFactory.provider(Preferences.getNetworkId(getContext()));
            try {
                // get locations from network provider
                SuggestLocationsResult result = np.suggestLocations(search);
                return result.getLocations();
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
        }
    };
    loader.setUpdateThrottle(750);
    return loader;
}