else if (item.getItemId() == R.id.sort_by_unprofitable_trades){
Collections.sort(notesList, Model.UnProfitableTrades);
adapter.notifyDataSetChanged();
}
else if(item.getItemId() == R.id.sort_by_date_range){
materialDatePicker.show(getSupportFragmentManager(), "Tag_picker");
materialDatePicker.addOnPositiveButtonClickListener(new
MaterialPickerOnPositiveButtonClickListener<Pair<Long, Long>>() {
@Override
public void onPositiveButtonClick(Pair<Long,Long> selection) {
Long selctedstartDate = selection.first;
Long selectedendDate = selection.second;
startDateString = DateFormat.format("yyyy/MM/dd", new
Date(selctedstartDate)).toString();
endDateString = DateFormat.format("yyyy/MM/dd", new
Date(selectedendDate)).toString();
//Collections.sort(notesList, Model.SortByDaterange);
sortByDateRange();
adapter.notifyDataSetChanged();
DataBase class:- void sortbyDateRange(String startDate, String endDate){ SQLiteDatabase database = this.getWritableDatabase(); String query = "SELECT * FROM " + TableName + " WHERE " + ColumnTradeDate + " BETWEEN " + startDate + " AND " + endDate ; database.execSQL(query); }
In Database Inspector the SQL query is giving correct results but no change is happening in the recycler view. What am I missing?
