Last active
December 17, 2015 04:19
-
-
Save npike/5549446 to your computer and use it in GitHub Desktop.
Typical CursorLoader creation: pulling a list of car models for a given a car make from a database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public Loader<Cursor> onCreateLoader(int id, Bundle args) { | |
final String[] projection = { BaseColumns._ID, ModelContract.Models.COLUMN_NAME_MODEL, | |
ModelContract.Models.COLUMN_NAME_NICE_NAME }; | |
new CursorLoader(getActivity(), ModelContract.Models.CONTENT_URI, projection, | |
ModelContract.Models.COLUMN_NAME_MAKE_NAME + "= ?", new String[] {"Jeep"}, | |
ModelContract.Models.COLUMN_NAME_MODEL + " ASC"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment