app-indexing icon indicating copy to clipboard operation
app-indexing copied to clipboard

AppIndexingService not fully implemented

Open JhonErl opened this issue 8 years ago • 3 comments

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 avatar Sep 13 '17 15:09 JhonErl

ดีคับ

wangpung12 avatar Jan 29 '18 17:01 wangpung12

@JhonErl did this change get the project working for you???

[EDIT] This changes runs it on my device, but not the emulator...

rvail2 avatar Jun 07 '18 02:06 rvail2

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.

JhonErl avatar Jun 07 '18 07:06 JhonErl