I am trying to pass a List (From an activity, AddClothesActivity) to create a class (Clothes). This step of information I do in the constructor.
The problem is that I miss a compilation error in which it says: Field "clothesList" of type "java.util.List" is not supported. where clothesList is a variable type List
Clothes class:
public class Clothes extends RealmObject{
@PrimaryKey
private int id;
@Required
private String name;
@Required
private String description;
private float stars;
private List<ImageView> clothesList;
public Clothes() {
}
public Clothes(String name, String description, float stars, List<ImageView> clothesList ) {
this.id = MyApp.CityID.incrementAndGet();
this.name = name;
this.description = description;
this.stars = stars;
this.clothesList = clothesList;
}
AddClothesActivity class:
Declaration
private ImageView photoGallery;
private List<ImageView> photos;
I add the photos I make or take from the gallery:
Uri path = data.getData();
photoGallery.setImageURI(path);
photos.add((photoGallery));
And I pass them with the constructor:
Clothes city = new Clothes(name, description, stars, photos);