SQLiteConstraintException: error code 19: constraint failed

后端 未结 1 596
野趣味
野趣味 2020-12-11 00:26

I\'m getting that exception when I do an insert in my SQLite database

The following code gives me the exception:

mDbHelper.createUser(\"pablo\",\"a\         


        
相关标签:
1条回答
  • 2020-12-11 01:22

    You are inserting a duplicate email.

    Plus the recommended way is to have a _ID column as primary key, even if you don't use it. This way on future uses, like use in a Adapter or List, you won't have to workaround.

    0 讨论(0)
提交回复
热议问题