如何将结果从两个不同的API保存到一个房间数据库表?
我想到了解决方案方法。 我可以使用Mergeadapter将数据显示在单个循环范围内,但是我可以使用两个不同的数据库表来执行此操作。
The solution method came to my mind.
I could display the data in a single recyclerview using MergeAdapter however I could do this with two different database tables.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使三个模型成为第一个API响应的第一个模型,第二个API响应的第二个模型是房间实体模型,并制作将第一个API模型和第二个API模型转换为房间实体模型的函数。现在,当您收到来自API的数据时,将其转换为房间型号并将其保存到房间数据库。
Make three models the first one for the first API response, the second one for the second API response and the third one is the room entity model, and make functions that convert the first API model and the second API model to the room entity model. Now when you receive the data from APIs convert it to room model and save it to room database.