Android Room - How to reset auto generated table primary key on each app run

前端 未结 4 1756
南方客
南方客 2020-12-06 08:02

I\'m using Room in order to persist data. I have a Entity that has a automatically generated (autoGenerate) primary key that mimics a ticket system. On every applica

4条回答
  •  无人及你
    2020-12-06 08:55

    You could create an in memory database instead of creating it on disk. Then you'll start with a clean slate every time. You may want to create a memory or disk based database depending on the value of BuildConfig.DEBUG.

提交回复
热议问题