删除一个存储的真实对象android

时间:2016-01-20 06:57:14

标签: android realm

我想删除一个存储的领域对象。但我一直在收到错误。

Could not find class 'io.realm.rx.RealmObservableFactory$1', referenced from method io.realm.rx.RealmObservableFactory.from

日志说,BYTE(expression) SHORT(expression) LONG(expression) QUAD(expression) By including one of these four statements in a section definition, you can explicitly place one, two, four, or eight bytes (respectively) at the current address of that section. QUAD is only supported when using a 64 bit host or target. Multiple-byte quantities are represented in whatever byte order is appropriate for the output file format (see section BFD).

如果我使用removeLast,它会抱怨不支持删除。有人可以帮帮我吗?

2 个答案:

答案 0 :(得分:0)

我通过将RxAndroid添加到我的项目依赖项中克服了这个问题。

编译'io.reactivex:rxandroid:0.25.0'

答案 1 :(得分:0)

@RealmClass
public abstract class RealmObject implements RealmModel {

    /**
     * Deletes the object from the Realm it is currently associated to.
     * <p>
     * After this method is called the object will be invalid and any operation (read or write) performed on it will
     * fail with an IllegalStateException.
     *
     * @throws IllegalStateException if the corresponding Realm is closed or in an incorrect thread.
     * @see #isValid()
     */
    public final void deleteFromRealm() {
        deleteFromRealm(this);
    }
......

}

这可能对您有所帮助..如果答案无效,请退回。