-2
我的ListView与公交车信息列表,我想申请的适配器或ListView中的多个过滤器,我已经做了ListView中实时搜索过滤器,如何在适配器或列表视图上应用多个过滤器?
这里是我的活动:
public class FilterListActivity extends Activity implements TextWatcher {
private static List<Country> countries = Storage.getItems();
private EditText editTextFilter;
private ListView listViewCountries;
private CountryListAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
adapter = new CountryListAdapter(this, countries);
editTextFilter = (EditText)findViewById(R.id.editTextFilter);
editTextFilter.addTextChangedListener(this);
listViewCountries = (ListView)findViewById(R.id.listViewCountries);
listViewCountries.setAdapter(adapter);
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
adapter.getFilter().filter(s);
}
@Override
public void afterTextChanged(Editable s) {}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
}
当我在文本视图上搜索它的搜索很好,但我想过滤ListView的面积和人口也。
你需要做更多的研究...尝试一些东西,写一些代码。 ..然后最终回到这里,如果你会遇到你的代码问题...现在你的问题是:**免费为我编写像xxx这样的应用程序** – Selvin
对不起Selvin,我被问到错误的方式,这个问题方法我跟着这个工作正常的国家搜索,但我想实现相同的功能区域过滤器以及人口过滤器 – Sahadev