-
-
Save jezinka/61762239e9e1285acccd1a16b8645575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void showAddRecipeDialog(final Meal meal) { | |
View view = getLayoutInflater().inflate(R.layout.multiline_dialog, null); | |
final EditText recipeText = (EditText) view.findViewById(R.id.multiline_edit_text); | |
recipeText.setText(meal.getRecipe()); | |
new AlertDialog.Builder(this) | |
.setTitle(R.string.recipe) | |
.setView(view) | |
.setPositiveButton(R.string.add, new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
mealContract.addRecipe(dbHelper, recipeText.getText().toString(), meal.getId()); | |
adapter.updateResults(mealContract.getAllMealsArray(dbHelper)); | |
} | |
}) | |
.setNegativeButton(R.string.cancel, null) | |
.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment