Example usage for android.content Loader getId

List of usage examples for android.content Loader getId

Introduction

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

Prototype

public int getId() 

Source Link

Usage

From source file:com.aengbee.android.leanback.ui.VerticalGridFragment.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (loader.getId() == ALL_VIDEOS_LOADER && cursor != null && cursor.moveToFirst()) {
        mVideoCursorAdapter.changeCursor(cursor);
    }//  w  w w .j  a v  a  2  s .  co  m
}

From source file:io.nuclei.box.PersistenceLoader.java

@Override
public void onLoaderReset(Loader<Cursor> loader) {
    if (mParams != null) {
        LoaderArgs<?> a = mParams.get(loader.getId());
        a.onAvailable(null);/*from   w  w w .  ja  va  2  s .com*/
    }
}

From source file:io.nuclei.box.PersistenceLoader.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    if (mParams != null) {
        LoaderArgs a = mParams.get(loader.getId());
        a.onAvailable(data);//  w w  w. ja  v  a2s  .c  o m
    }
}

From source file:foo.bar.permission2.PermissionActivity.java

@Override
public void onLoaderReset(Loader<Cursor> loader) {
    switch (loader.getId()) {
    case CONTACTS_LOADER: {
        mContactsAdapter.swapCursor(null);
    }/* w ww  .  j av  a 2 s . c  om*/
        break;

    case EVENTS_LOADER: {
        mEventsAdapter.swapCursor(null);
    }
        break;
    }
}

From source file:foo.bar.permission2.PermissionActivity.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    switch (loader.getId()) {
    case CONTACTS_LOADER: {
        mContactsAdapter.swapCursor(cursor);
    }// w w w.  j  a  v  a 2 s .c om
        break;

    case EVENTS_LOADER: {
        mEventsAdapter.swapCursor(cursor);
    }
        break;
    }
}

From source file:fr.tvbarthel.apps.sayitfromthesky.activities.MainActivity.java

@Override
public void onLoaderReset(Loader<Cursor> cursorLoader) {
    final int loaderId = cursorLoader.getId();
    if (loaderId == LOADER_ID_DRAWINGS)
        resetDrawingLoader();//from  w  w w.  jav  a 2s  . c o  m
}

From source file:com.google.samples.apps.iosched.ui.HashtagsFragment.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (loader.getId() == HashtagsQuery.TOKEN) {
        final HashtagsAdapter adapter = new HashtagsAdapter(getActivity(), cursor);
        mCollectionView.setCollectionAdapter(adapter);
        mCollectionView.updateInventory(adapter.getInventory());
        mCollectionView.setOnScrollListener(new AbsListView.OnScrollListener() {
            @Override//from ww  w .  j  a v  a 2 s  .  co m
            public void onScrollStateChanged(AbsListView view, int scrollState) {
                adapter.hideDescriptionToast();
            }

            @Override
            public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
                    int totalItemCount) {
            }
        });
    }
}

From source file:fr.tvbarthel.apps.sayitfromthesky.activities.MainActivity.java

@Override
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
    final int loaderId = cursorLoader.getId();
    if (loaderId == LOADER_ID_DRAWINGS)
        finishDrawingLoading(cursor);/*from w w w . j  a va2  s.  c  om*/
}

From source file:org.mars3142.android.toaster.fragment.NavigationDrawerFragment.java

@Override
public void onLoaderReset(Loader<Cursor> loader) {
    switch (loader.getId()) {
    case DATA_LOADER:
        mDrawerListView.setAdapter(null);
        break;/*w ww  .  j  a  va2 s. c  o  m*/

    default:
        throw new IllegalArgumentException();
    }
}

From source file:org.mars3142.android.toaster.fragment.NavigationDrawerFragment.java

@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    switch (loader.getId()) {
    case DATA_LOADER:
        mNavList = new ArrayList<ToastCard>();

        ToastCard emptyCard = new ToastCard(getActionBar().getThemedContext());
        emptyCard.appName = getString(R.string.all_data);
        mNavList.add(emptyCard);/*from  ww  w  . ja  v a 2s  .co  m*/

        if (data.moveToFirst()) {
            do {
                ToastCard packageCard = new ToastCard(getActionBar().getThemedContext());
                packageCard.packageName = data.getString(data.getColumnIndex(ToasterTable.PACKAGE));
                if (packageCard.packageName != null) {
                    packageCard.loadData();
                    mNavList.add(packageCard);
                }
            } while (data.moveToNext());
        }
        Collections.sort(mNavList, new ToastCardComparator());
        Collections.swap(mNavList, mNavList.indexOf(emptyCard), 0);

        mDrawerListView.setAdapter(new ToastArrayAdapter(getActionBar().getThemedContext(), mNavList));
        mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
        break;

    default:
        throw new IllegalArgumentException();
    }
}