Using the RealmObject with Databinding


I’m using the RealmObject model for databinding. It worked fine but now I want my views to update when data changes and I implemented Observable.

The model is:

public class RealmArticle extends RealmObject implements Observable {

    public RealmArticle() {

    private PropertyChangeRegistry registry =
            new PropertyChangeRegistry();

    public String getCountText() {
        return countText;

    public void setCountText(String countText) {
        this.countText = countText;
        registry.notifyChange(this, BR.obj);

    public void addOnPropertyChangedCallback(OnPropertyChangedCallback callback) {

    public void removeOnPropertyChangedCallback(OnPropertyChangedCallback callback) {

The problem is that RealmObject doesn’t support the fields of PropertyChangeRegistry type.

Android studio says: Error:(18, 8) error: Field "registry" of type "android.databinding.PropertyChangeRegistry" is not supported.

Is there a way to implement this interface without violating RealmObject functionality?


You can put the @Ignore annotation on the field, that should enable you to use it. See e.g.


hey how had you binded data with Realm in Android?