Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. @Override
  2. public void onLoadFinished(@NonNull Loader<Cursor> loader, Cursor data) {
  3. if (data != null) {
  4. if (data.getCount() > 0) {
  5. data.moveToFirst();
  6.  
  7. do {
  8. mSupportedRecipes.add(
  9. data.getString(
  10. data.getColumnIndex(
  11. RecipeContract.RecipeIngredient.COLUMN_RECIPE_NAME)));
  12. } while (data.moveToNext());
  13. }
  14.  
  15. // Clean-up the resource
  16. data.close();
  17.  
  18. // Once closed the data can be fetched
  19. NetworkUtils.getRecipesFromNetwork(this);
  20. }
  21. }
Add Comment
Please, Sign In to add comment