Android ListView Filtreleme – Arama Yapma

final String[] araba =
        {"Volvo","Audi","Renault","BMW"};
EditText etSearch;
listView=(ListView)findViewById(R.id.listCars);
etSearch=(EditText)findViewById(R.id.etSearch);
veriAdaptoru=new ArrayAdapter<String>
        (Fault.this, R.layout.custom_listview, R.id.tvList, araba);
listView.setAdapter(veriAdaptoru);
etSearch.addTextChangedListener(new TextWatcher() {
    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

        (Fault.this).veriAdaptoru.getFilter().filter(charSequence);
    }

    @Override
    public void afterTextChanged(Editable editable) {

    }
});

İlk yorum yapan olun

Bir yanıt bırakın

E-posta hesabınız yayımlanmayacak.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.