Search code examples
javaandroidrealm

Realm findAll with case Insensitive on Android


I have an Contact who have a a colum name, that have names on Lower and upercase. I'd want to findAll with Case.INSENSITIVE and i didn't match any answers. How i should do that?

I'm doing it :

realm.where(Contact.class).findAllAsync().sort("name")

Solution

  • Realm doesn't have a native solution for that question.

    I have solved it creating an extra colum with lowerCases "name", and then a sort by lowerCase, like this:

    realm.where(Contact.class).findAllSortedAsync("lowerCase"));