I am trying to filter the listview but getfilter method is not working,
here is the code:
@Override
public void afterTextChanged(Editable s) {
}
@Ov
I think there is no need of getfilter() method over here
ArrayList data;
.
.
.
Collections.sort(data, new Comparator() {
@Override
public int compare(YourDataModel data1, YourDataModel data2) {
if( data1.getDistance() < data2.getDistance() )
return 1;
else
return 0;
}
});
.
.
.
ListView lvData = (ListView) findViewById(R.id.listview1);
MyCustomAdapter adapter = new MyCustomAdapter(this, R.layout.listview_item_row, data);
lvData.setAdapter(adapter);
and use notifydatachange
method whenever you want to update it