You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 17, 2020. It is now read-only.
Hey, I noticed that the getAllRecipes() function in AppIndexingService is not fully implemented,
so i suggest the following, i know that it is not the best solution but is works.
public class AppIndexingService extends IntentService {
. . .
private List<Recipe> getAllRecipes() {
ArrayList recipesList = new ArrayList();
String[] projection = {RecipeTable.ID, RecipeTable.TITLE,
RecipeTable.DESCRIPTION, RecipeTable.PHOTO,
RecipeTable.PREP_TIME};
Uri sUri = RecipeContentProvider.CONTENT_URI.buildUpon().build();
Cursor cursor = getContentResolver().query(sUri, projection,
null, null, null);
cursor.moveToFirst();
while (cursor != null && !cursor.isAfterLast()){
recipesList.add( Recipe.fromCursor(cursor));
cursor.moveToNext();
`}`
}
return recipesList;
}