I have a question for Room Retrofit 2

Asked 2 years ago, Updated 2 years ago, 26 views

Are there any precautions when inserting the results of the response received from Retrofit2 in the Room?

Response results received from Retrofit

When I insert in Room, I kept getting errors in doInbackground, so I checked the error that the data is null.

I have no idea where or how to deal with it.

android

2022-09-22 14:16

1 Answers

There is a conflict condition set for insert or other methods.

@Insert(onConflict = OnConflictStrategy.REPLACE)

Why don't you look for a conflict?


2022-09-22 14:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.