AppIndexingService not fully implemented
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;
}
ดีคับ
@JhonErl did this change get the project working for you???
[EDIT] This changes runs it on my device, but not the emulator...
On Thu, 7 Jun 2018 at 5:21 rvail2 [email protected] wrote:
@JhonErl https://github.com/JhonErl did this change get the project working for you???
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlecodelabs/app-indexing/issues/3#issuecomment-395271635, or mute the thread https://github.com/notifications/unsubscribe-auth/AWZe9-Q1NAb7aUclXCqHgj__p6rX8c0zks5t6I4XgaJpZM4PWT7i .
As I recall it did, but let me check it when I get home and verify it.