if suppose u have list of items in array you need to set it into list,and then use EditText for searching,you can implement it by
by using EditText addTextChangedListener(this) action listener by implementing three method and do what u need
here the sample code of this implementaion has follows
@Override
public void afterTextChanged(Editable s) {
try{
text = textView.getText().toString();
string1 = text.substring(0,1).toUpperCase() + text.substring(1);
}catch(Exception e)
{
Log.v("Text_Hereeeee++++++++++++++++++++++++++++e","NULL"+Integer.toString(a.length));
// wv.setVisibility(View.GONE);
lv.setVisibility(View.GONE);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Bru_Maps.this,R.layout.listitem, a);
lv.setAdapter(adapter);
lv.setVisibility(View.VISIBLE);
empty_text=2;
temp_VALUE1=null;
VALUE1=a;
}
if(empty_text==1){
Log.v("Text from ",text);
Set <String> has_set = new TreeSet<String>(search_List);
if(string1!=null)
{
Log.v("string1_for New array",string1);
for(int i=0;i<VALUE1.length;i++)
{
String a = string1;
if(VALUE1[i].startsWith(a))
{
// Log.v("NoDuplicate New array","null");
has_set.add(VALUE1[i]);
}
else{
continue;
}
}
}
Log.v("Text_Her********************e","NULL"+Integer.toString(VALUE1.length));
carArray = new String[has_set.size()];
has_set.toArray(carArray);
temp_VALUE1=carArray;
lv.setVisibility(View.GONE);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Bru_Maps.this,R.layout.listitem, temp_VALUE1);
Log.v("Adapter_Get_count",Integer.toString(adapter.getCount()));
lv.setAdapter(adapter);
lv.setVisibility(View.VISIBLE);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
Log.v("beforeTextChanged",s.toString());
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.v("onTextChanged",s.toString());
empty_text=1;
}
here i just managing two arrays, one is original from that is a and another one is sorted array temp_VALUE1 set in adapter.