Android MutableRealmInteger上的notifyPropertyChanged

Android MutableRealmInteger上的notifyPropertyChanged,android,data-binding,realm,Android,Data Binding,Realm,我正在使用领域和数据绑定 在MutableRealmInteger之前,我使用常规原语类型并使用其setter,UI会自动更改为新值。 现在我想使用MutableRealmIntegertype,但我不知道如何通知UI更改 这是我的模型的一部分: public class MyModel extends RealmObject implements Observable { ... public final MutableRealmInteger NewWayAAA = MutableRealm

我正在使用
领域
数据绑定

MutableRealmInteger
之前,我使用常规原语类型并使用其setter,UI会自动更改为新值。
现在我想使用
MutableRealmInteger
type,但我不知道如何通知UI更改

这是我的模型的一部分:

public class MyModel extends RealmObject implements Observable {
...
public final MutableRealmInteger NewWayAAA = MutableRealmInteger.valueOf(0);
private String oldWayAAA = "0";
...

@Bindable
public String getOldWayAAA() {
    return oldWayAAA.isEmpty() ? "0" : oldWayAAA;
}

public void setOldWayAAA (String param) {
    if (!param.isEmpty()) {
        this.oldWayAAA= param;
        notifyPropertyChanged(BR.oldwayaaa);
    }
}

...

/**
 * Notifies listeners that all properties of this instance have changed.
 */
public synchronized void notifyChange() {
    if (mCallbacks != null) {
        mCallbacks.notifyCallbacks(this, 0, null);
    }
}

/**
 * Notifies listeners that a specific property has changed. The getter for the property
 * that changes should be marked with {@link Bindable} to generate a field in
 * <code>BR</code> to be used as <code>fieldId</code>.
 *
 * @param fieldId The generated BR id for the Bindable field.
 */
public void notifyPropertyChanged(int fieldId) {
    if (mCallbacks != null) {
        mCallbacks.notifyCallbacks(this, fieldId, null);
    }
}

@Override
public void addOnPropertyChangedCallback(OnPropertyChangedCallback onPropertyChangedCallback) {
    if (mCallbacks == null) {
        mCallbacks = new PropertyChangeRegistry();
    }
    mCallbacks.add(onPropertyChangedCallback);
}

@Override
public void removeOnPropertyChangedCallback(OnPropertyChangedCallback onPropertyChangedCallback) {
    if (mCallbacks != null) {
        mCallbacks.remove(onPropertyChangedCallback);
    }
}
MutableRealmInteger
没有setter,其用法如下:

myModelIns.NewWayAAA.increment(10);

我真丢脸:))
public class MyModel extends RealmObject implements Observable {
    ...
    private final MutableRealmInteger NewWayAAA = MutableRealmInteger.valueOf(0);
    ...

    @Bindable
    public int getNewWayAAA() {
        return NewWayAAA.getValue();
    }

    public void incrementNewWayAAA() {
        NewWayAAA.increment();
        notifyPropertyChanged(BR.newwayaaa);
    }

    ...