search a listview in Persian
Posted
by
user3641353
on Stack Overflow
See other posts from Stack Overflow
or by user3641353
Published on 2014-05-29T03:22:12Z
Indexed on
2014/05/29
3:24 UTC
Read the original article
Hit count: 195
I have listview with textview which I use textview for search items in listview. It works true but just in English. I can not change the keyboard to Persian.
Do you have any solution?
this is my code:
ArrayAdapter<String> adapter;
String[] allMovesStr = {"??? ???? ????","?? ???? ????","?? ???? ????? ???????"};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.all_moves);
adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, allMovesStr);
setListAdapter(adapter);
EditText ed = (EditText) findViewById(R.id.inputSearch);
ListView lv = (ListView) findViewById(android.R.id.list);
lv.setTextFilterEnabled(true);
ed.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub
}
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}
public void afterTextChanged(Editable arg0) {
// vaghti kar bar harfi vared kard josteju mikone :
AllMoves.this.adapter.getFilter().filter(arg0);
}
});
}
© Stack Overflow or respective owner