How can we give a default to the realm model field?
Example :
class Demo extends RealmObject{
private String id; // I want to set this id to a uuid
private boolean isVisibile; // set this to default as true
}
class Demo extends RealmObject{
public Demo() {
id = UUID.randomUUID().toString();
isVisible = true;
}
@PrimaryKey
private String id; // I want to set this id to a uuid
private boolean isVisibile; // set this to default as true
}
Should work Realm 2.0+