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
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!
You may like these posts
Post a Comment for "Open/close Sql Database On The Same Thread"