Sorting

A 2-post collection

If you are using the RuleBasedCollator in your app, you may get NullpointerException for your collator object if you do not properly initialize its constructor with a correctly formatted rule string. In Android 5.0 and later, the constructor expects to get a rule string that has a reset character in the first rule chain. Refer to the documentation: Note: earlier versions of RuleBasedCollator up to and including Android 4.4 (KitKat) allowed the omission of the reset from the

If you are using SQLite database, with a Cursor or Perhaps Content provider, you may have come across alphabetical sorting problems regarding upper and lowercase letters. Perhaps you are requesting a cursor from a Content Provider: String[] projection = { Table.COLUMN_ID, Table.COLUMN_TITLE}; String sortOrder = Table.COLUMN_TITLE + " COLLATE NOCASE ASC"; CursorLoader cursorLoader = new CursorLoader(this, YourProvider.CONTENT_URI, projection, null, null, sortOrder); The solution to the alphabetical sorting problem is the COLLATE NOCASE in the part of the