[問題] 關於使用filter過濾中文的問題
小弟想要實現在editext中打上一個字
便會在listview裡開始過濾
但是目前的結果是
英文沒有問題
但是中文的話
例如:
listview中有:
小白
白色
我輸入了"白"
卻只會跑出"白色"
不會顯示"小白"
我想要讓任何包含白字的能顯示出來
inputSearch.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence cs,
int arg1, int arg2, int arg3) {
simpleAdapter.getFilter().filter(cs);
}
@Override
public void beforeTextChanged(CharSequence arg0,
int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub
}
});
還有就是
過濾之後 我的點擊事件
例如: 早上 0
中午 1
晚上 2
過濾晚上之後會變成
晚上 0
這樣我就不能用POSITION來做偵測的方式了
以上是我的問題以及程式碼
謝謝各位
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.102.223
※ 編輯: justhb0928 來自: 220.134.102.223 (10/05 16:40)
→
10/07 11:37, , 1F
10/07 11:37, 1F
→
10/12 14:11, , 2F
10/12 14:11, 2F