Example usage for android.content CursorLoader CursorLoader

List of usage examples for android.content CursorLoader CursorLoader

Introduction

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

Prototype

public CursorLoader(Context context, Uri uri, String[] projection, String selection, String[] selectionArgs,
        String sortOrder) 

Source Link

Document

Creates a fully-specified CursorLoader.

Usage

From source file:de.hshannover.f4.trust.ironcontrol.view.list_activities.ListOverviewActivity.java

@Override
protected Loader<Cursor> onCreateLoader(int id, Bundle args, ListHierarchyType type) {
    Uri uri = null;/*  w  w  w  .  ja  v a 2 s.  com*/
    switch (type) {
    case SEARCH:
        uri = DBContentProvider.SEARCH_URI;
        break;
    case SUBSCRIPTION:
        uri = DBContentProvider.SUBSCRIPTION_URI;
        break;
    }
    CursorLoader cursorLoader = new CursorLoader(this, uri, null, null, null, null);
    return cursorLoader;
}

From source file:fr.poucedor.poucedor.MapActivity.java

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    switch (id) {
    case URL_LOADER:
        return new CursorLoader(this, PoucedorProvider.CONTENT_URI, new String[] {
                DatabaseContract.Team.COLUMN_NAME_FD, DatabaseContract.Team.COLUMN_NAME_FD_LATITUDE,
                DatabaseContract.Team.COLUMN_NAME_FD_LONGITUDE, DatabaseContract.Team.COLUMN_NAME_LAST_LATITUDE,
                DatabaseContract.Team.COLUMN_NAME_LAST_LONGITUDE, DatabaseContract.Team.COLUMN_NAME_NAME,
                DatabaseContract.Team.COLUMN_NAME_STUDENT1_NAME,
                DatabaseContract.Team.COLUMN_NAME_STUDENT2_NAME }, null, null, null);
    default://from w ww  .j  a va 2s  . co  m
        return null;
    }
}

From source file:com.silentcircle.contacts.ContactTileLoaderFactory.java

public static CursorLoader createStarredLoader(Context context) {
    return new CursorLoader(context, Contacts.CONTENT_URI, COLUMNS, Contacts.STARRED + "=?",
            new String[] { "1" }, STARRED_ORDER);
}

From source file:org.catnut.util.CatnutUtils.java

/**
 * raw sql?cursor?havinggroup/*from   ww w .ja  va2  s.  c  o  m*/
 *
 * @param context
 * @param uri
 * @param projection
 * @param selection
 * @param selectionArgs
 * @param from
 * @param joinOn
 * @param sort
 * @param limit
 * @return {@link android.content.CursorLoader}
 */
public static CursorLoader getCursorLoader(Context context, Uri uri, String[] projection, String selection,
        String[] selectionArgs, String from, String joinOn, String sort, String limit) {
    String sql = buildQuery(projection, selection, from, joinOn, sort, limit);
    return new CursorLoader(context, uri, null, sql, selectionArgs, null);
}

From source file:com.baqsoft.listas.ui.overview.ListActivity.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.
 *//*from w w w.  java2  s .  c om*/
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    return new CursorLoader(this, Uri.parse(ListasContract.NavListContract.URI_STRING), sNavProjection, null,
            null, null);
}

From source file:com.example.android.sampletvinput.SearchFragment.java

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    String query = mQuery;/* w ww. j  av  a2 s . c  om*/
    return new CursorLoader(getActivity(), VideoContract.VideoEntry.CONTENT_URI, null, // Return all fields.
            VideoContract.VideoEntry.COLUMN_NAME + " LIKE ? OR " + VideoContract.VideoEntry.COLUMN_DESC
                    + " LIKE ?",
            new String[] { "%" + query + "%", "%" + query + "%" }, null // Default sort order
    );
}

From source file:me.abhrajit.hackernewsreader.MainActivity.java

@Override
public android.content.Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
    return new CursorLoader(this, HackerNewsProvider.NewsFeed.CONTENT_URI, null, mFilterCursor, null,
            DetailColumns.RANK + " ASC");

}

From source file:io.github.protino.codewatch.ui.ProfileActivity.java

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    return new CursorLoader(this, LeaderContract.LeaderEntry.buildProfileUri(userId), null, null, null, null);
}

From source file:org.catnut.plugin.zhihu.ZhihuItemsFragment.java

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    return new CursorLoader(getActivity(), CatnutProvider.parse(Zhihu.MULTIPLE), PROJECTION, null, null,
            BaseColumns._ID + " desc limit " + mCount);
}

From source file:fr.alecanu.samplerssreader.RssReaderActivity.java

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {

    return new CursorLoader(this, ArticleProvider.CONTENT_URI, null, null, null, null);
}