私はArrayList
に検索して整数を置く際に問題に直面しています。 Logcatは何も整数 - ArrayList -
public void GetRecipes(String meal_cat_selected, ArrayList<String> User_Main_Ing) {
SQLiteDatabase db = this.getReadableDatabase();
User_Main_Ingredients = User_Main_Ing;
for (int i = 0; i <User_Main_Ingredients.size(); i++) {
Log.i("User_Main_Ingredients", User_Main_Ingredients.get(i).toString());
}
String mealcat=meal_cat_selected;
Cursor cursor_recipes = db.rawQuery("SELECT " + RECIPE_COLUMN_ID + " FROM " + RECIPES_TABLE_NAME + " where " + MEAL_CATEGORY + "=" + mealcat, null);
int i,id;
cursor_recipes.moveToFirst();
while (cursor_recipes.isAfterLast() == false) {
recipes.add(cursor_recipes.getInt(cursor_recipes.getColumnIndex(RECIPE_COLUMN_ID)));
cursor_recipes.moveToNext();
}
for (i = 0; i < recipes.size(); i++) {
Log.i("Recipes",Integer.toString(recipes.get(i)));
}
for (i = 0; i < recipes.size(); i++) {
id = recipes.get(i);
boolean result = checkrecipe(id);
if (result == true) {
matchedRecipes[i] = i;
}
}
}
これは間違っています。 – Priyamal