I know how to save a list of Objects in Room database. But I really don't know how to save a list of primitive type i.e ArrayList<String> using Room. Any help is appreciated.
I know that I can have a class like this:
@Entity
public class MyData {
@ColumnInfo(name = "data")
private String data;
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
And save the data using the conventional way. But I think there must be an easier way of saving simple data lists like ArrayList<String> using Room.