how do I check whether certain value is exist or not in my realm database based on this code below?
realm.where(User.class).equalTo("cardId", cardId).findFirst()
Thanks in advance.
You can perform null check.
User user = realm.where(User.class).equalTo("cardId", cardId).findFirst();
if (user != null) {
// Exists
} else {
// Not exist
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With