UNIQUE constraint failed: sqlite database : android

前端 未结 10 2035
野的像风
野的像风 2020-12-05 09:34

I am trying to insert values in table. But there is only one value inserted. I am getting an error in log cat when I am trying to insert new values.

Log cat shows :

10条回答
  •  孤街浪徒
    2020-12-05 10:08

    For developers using Room Persistence Library. You can use

    @Insert(onConflict = OnConflictStrategy.REPLACE)  // or OnConflictStrategy.IGNORE
    

    in DAO according to Insert Documentation

提交回复
热议问题