My Book.class
that extends realmobject
public class Book extends RealmObject {
private String title;
private String author;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}
How do I find out if these objects are empty?
I've tried:
public boolean hasBook() {
return !realm.allObjects(Book.class).isEmpty();
}
But it did not work.