I am developing an application which requires use of an SQLite database. I have implemented fetching the data, but I am facing problems when I try to insert data. The proble
Try with this code this may help you
public void insertTitle(String Recipe)
{
ContentValues initialValues = new ContentValues();
initialValues.put(COLUMN_NAME,Recipe);
myDataBase.insert(ZRECIPE, null, initialValues);
}
Try it this way. You need first start transaction, then mark it as successful and end.
try {
myDataBase.beginTransaction();
myDataBase.insert(ZRECIPE, null, initialValues);
myDataBase.setTransactionSuccessful();
}
finally {
myDataBase.endTransaction();
}
You forgot to commit the transaction.