Last active
August 2, 2016 13:03
-
-
Save chelseatroy/dacdd9ba3336d9c4415d3c5a5b78cc19 to your computer and use it in GitHub Desktop.
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
public class NutritionFactFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> { | |
public static final int FRUIT_LOADER = 1; | |
public static final int VEGGIE_LOADER = 2; | |
... | |
@Override | |
public Loader<Cursor> onCreateLoader(int id, Bundle args) { | |
switch (id) { | |
case FRUIT_LOADER: | |
CursorLoader fruitCursorLoader = new CursorLoader( | |
getActivity(), | |
Uri.parse(NutritionContract.Fruit.CONTENT_URI), | |
null, | |
null, | |
null, | |
null | |
); | |
return fruitCursorLoader; | |
case VEGGIE_LOADER: | |
CursorLoader veggieCursorLoader = new CursorLoader( | |
getActivity(), | |
Uri.parse(NutritionContract.Veggies.CONTENT_URI), | |
null, | |
null, | |
null, | |
null | |
); | |
return veggieCursorLoader; | |
default: | |
return null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment