Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用房间数据库来保存通知类型的对象。所以我实现了房间数据库的三个组件。它是这样的:
1. 我实施的实体
2. 我实施的Doa
3. 我实现的数据库
我在 Logcat 中收到错误消息: 我遇到的错误
在您的 NotificationDao 界面中,将 onConflict 属性添加到插入函数。您可以选择替换、忽略或中止选项。
例如:
@Insert(onConflict = OnConflictStrategy.REPLACE) fun insertAll(varargs users:Notification)