Hello,
What is the problem with this code? It doesn't catch the exception thrown by insertChild() method.
childDbOps.open();
try {
childDbOps.insertChild(child);
} catch (SQLiteException exception) {
Log.i("error la inserare child", "on the next line");
exception.printStackTrace();
} finally {
childDbOps.close();
}
The error is:
ERROR/Database(320): android.database.sqlite.SQLiteConstraintException: error code 19:
constraint failed at com.android.dataLayer.DbAdapter.insertChild(DbAdapter.java:169)
at com.android.activities.ChildInsertActivity.onClick(ChildInsertActivity.java:203)
at android.view.View.performClick(View.java:2344)
It is android sqlite. The line is when the insert method is called