Custom filtering for Custom ArrayAdapter in ListView

前端 未结 4 2127
小鲜肉
小鲜肉 2021-01-16 03:58

i write a own ArrayAdapter like this one:

public class PoiListAdapter extends ArrayAdapter implements Filterable {

    private Context context;
          


        
4条回答
  •  耶瑟儿~
    2021-01-16 04:39

    ConcurentModification can be avoided in two ways :

    1. poiListAdapter.addValuesPoi(p) add this code in a synchronized method .Synchronized method can't be accessed concurrently .

    2. Use Collections.synchronizedList

提交回复
热议问题