Skip to content

Instantly share code, notes, and snippets.

@jezinka
Created May 12, 2017
Embed
What would you like to do?
private void showShoppingListDialog() {
MealIngredientContract mealIngredientContract = new MealIngredientContract();
Dinner[] dinners = dinnerContract.getDinners(dbHelper);
List<Meal> meals = new ArrayList<>();
for (Dinner dinner : dinners) {
Meal meal = dinner.getMeal();
meals.add(meal);
}
AlertDialog d = new AlertDialog.Builder(this)
.setTitle(R.string.shopping_list)
.setPositiveButton(android.R.string.ok, null)
.setMessage(mealIngredientContract.getShoppingList(meals, dbHelper))
.create();
d.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment