Here I am going to explain how to select from auto completion Textview only.
clientName.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
if(!b) {
String str = clientName.getText().toString();
ListAdapter listAdapter = clientName.getAdapter();
for(int i = 0; i < listAdapter .getCount(); i++) {
String temp = listAdapter .getItem(i).toString();
if(str.compareTo(temp ) == 0) {
return;
}
}
clientName.setText("");
}
}
});
Happy Coding :)
No comments:
Post a Comment