Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Realm auto-increment
public int getNextID() {
return mRealm.allObjects(YOUR_CLASS).size() > 0 ? realm.where(YOUR_CLASS).max("id").intValue() + 1 : 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.