Best code examples for Android CursorLoader class (android.content.CursorLoader)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android CursorLoader class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android CursorLoader examples from Open Source projects
Examples using Android CursorLoader setProjection method:
This code example shows how to use the following methods: setProjection, setSelection, setSortOrder, setUri
60:	loader.setUri(ContactMethods.CONTENT_URI); 
61:	loader.setProjection(POSTALS_PROJECTION); 
62:	loader.setSortOrder(People.DISPLAY_NAME); 
63:	loader.setSelection(ContactMethods.KIND + "=" + android.provider.Contacts.KIND_POSTAL); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setProjection, setSortOrder, setUri
60:	loader.setUri(Phones.CONTENT_URI); 
61:	loader.setProjection(PHONES_PROJECTION); 
62:	loader.setSortOrder(Phones.DISPLAY_NAME); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setProjection, setSortOrder, setUri
59:	loader.setUri(People.CONTENT_URI); 
60:	loader.setProjection(PEOPLE_PROJECTION); 
61:	loader.setSortOrder(People.DISPLAY_NAME); 
Full Snippet Info
7
CodeRank
Examples using Android CursorLoader setSortOrder method:
This code example shows how to use the following methods: setProjection, setSortOrder, setUri
56:	loader.setUri(People.CONTENT_URI); 
57:	loader.setProjection(PEOPLE_PROJECTION); 
58:	loader.setSortOrder(People.DISPLAY_NAME); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setProjection, setSortOrder, setUri
60:	loader.setUri(Phones.CONTENT_URI); 
61:	loader.setProjection(PHONES_PROJECTION); 
62:	loader.setSortOrder(Phones.DISPLAY_NAME); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: loadInBackground, setSelection, setUri
72:	CursorLoader cl = new CursorLoader(getApplicationContext()); 
73:	cl.setUri(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI); 
74:	cl.setSelection("album_id = " + Long.toString(idAlbum)); 
75:	Cursor c = cl.loadInBackground(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: loadInBackground
54:	CursorLoader cursorLoader =  new CursorLoader(this, contactData, projection, selection, null, null); 
55:	Cursor cursor = cursorLoader.loadInBackground(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: loadInBackground
121:	CursorLoader cursorLoader = new CursorLoader(activity, contentUri, proj, null, null,null); 
-
124:	Cursor cursor = cursorLoader.loadInBackground(); 
Full Snippet Info
5
CodeRank
Examples using Android CursorLoader setSelection method:
This code example shows how to use the following methods: setProjection, setSelection, setSortOrder, setUri
60:	loader.setUri(ContactMethods.CONTENT_URI); 
61:	loader.setProjection(POSTALS_PROJECTION); 
62:	loader.setSortOrder(People.DISPLAY_NAME); 
63:	loader.setSelection(ContactMethods.KIND + "=" + android.provider.Contacts.KIND_POSTAL); 
Full Snippet Info
6
CodeRank
Examples for other Android CursorLoader methods:
Related Android CursorLoader Questions & Answers:
Other Android CursorLoader Examples
49:	        // Now create and return a CursorLoader that will take care of
50:	        // creating a Cursor for the data being displayed.
51:	        return new CursorLoader(this, ContactsContract.Data.CONTENT_URI,
52:	                PROJECTION, SELECTION, null, null);
53:	    }

Read More

CursorLoader Class Overview
A loader that queries the ContentResolver and returns a Cursor. This class implements the Loader protocol in a standard way for querying cursors, building on AsyncTaskLoader to perform the cursor query on a background thread so that it does not block the application's UI. A CursorLoader must be built with the full information for the query to perform, either through the CursorLoader(Context, Uri, String[], String, String[], String) or creating an empty instance with CursorLoader(Context) and filling in the desired paramters with setUri(Uri), setSelection(String), setSelectionArgs(Str...
Methods
  • loadInBackground
    Called on a worker thread to perform the actual load and to return the result of the load operation.