Skip to content Skip to sidebar Skip to footer

Open/close Sql Database On The Same Thread

I'm developing a recipe book and I'm implementing this method to insert my Recipe in the Database. In the for cycle I get the ingredient's name and quantity from multiples EditText

Solution 1:

Ok, thanks to your comment we got the problem :)

You are calling .add(newIngredient) on a list that you initialized with ArrayList<Ingredient> ingredients = null;

Change it to

ArrayList<Ingredient> ingredients = new ArrayList<Ingredient>();

and it will work :)

Good luck!

Post a Comment for "Open/close Sql Database On The Same Thread"