Design + Code an Android App from Scratch
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.