1
My Book.class
extending 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 tried to:
public boolean hasBook() {
return !realm.allObjects(Book.class).isEmpty();
}
But it didn’t work.