Create your account

Already have an account? Login here

Note: By joining, you will receive periodic emails from Coursetro. You can unsubscribe from these emails.

Create account

82. Sort Data In RecyclerView

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

This video shows you how to sort data inside our Recycler View on the basis of ascending and descending order of a goal’s target date. It also lets you display items which are either complete or incomplete. Use the onOptionsItemSelected method to jump between the different sorting options and the findAllSortedAsync method to specify the instance variable on the basis of which the sorting should take place along with the nature of the sort, whether its ascending or descending asynchronously. To display only complete or incomplete items, query all the items from the Drops table and filter those whose completed status is true for complete items and false for incomplete items. Use a RealmChangeListener to get notified when the results are loaded asynchronously and update the Adapter accordingly.

Course Cirriculum