app/src/main/java/com/adroitdevs/belanja/MainActivity.java
private void reloadTasksFromModel() {

        List<Task> tasks = sTasks.allTasks();

        // Sort list to show alphabetical order, top to bottom.
        Collections.sort(tasks, new Comparator<Task>() {
            @Override
            public int compare(Task task1, Task task2) {
                return task1.getDescription().compareToIgnoreCase(task2.getDescription());
            }
        });

        this.mTaskAdapter = new TaskAdapter(this, tasks);
        listView.setAdapter(this.mTaskAdapter);
    }
// Copies Local Cloudant Store into Array List for adapter to translate Tasks onto the List view.
Copies Local Cloudant Store into Array List for adapter to translate Tasks onto the List view.
Copies Local Cloudant Store into Array List for adapter to translate Tasks onto the List view .
private void reloadTasksFromModel() {
        List<Task> tasks = sTasks.allTasks();
        Collections.sort(tasks, new Comparator<Task>() {
            @Override
            public int compare(Task task1, Task task2) {
                return task1.getDescription().compareToIgnoreCase(task2.getDescription());
            }
        });
        this.mTaskAdapter = new TaskAdapter(this, tasks);
        listView.setAdapter(this.mTaskAdapter);
    }
private void reloadTasksFromModel ( ) { List < Task > tasks = sTasks . allTasks ( ) ; Collections . sort ( tasks , new Comparator < Task > ( ) { @ Override public int compare ( Task task1 , Task task2 ) { return task1 . getDescription ( ) . compareToIgnoreCase ( task2 . getDescription ( ) ) ; } } ) ; this . mTaskAdapter = new TaskAdapter ( this , tasks ) ; listView . setAdapter ( this . mTaskAdapter ) ; }
Copies Local Cloudant Store into Array List for adapter to translate Tasks onto the List view.
Copies Local Cloudant Store into Array List for adapter to translate Tasks onto the List view .
// Sort list to show alphabetical order, top to bottom.