複数行のリスト ビュー (1 つの項目に 4 行) を実装しました。リスト ビューの 2 行目にのみ基づいて検索したいのですが、テキスト ウォッチャーを使用して検索機能を実装しましたが、正しく動作しません。みんな助けてください。よろしくお願いします。
inputsearch = (EditText) findViewById(R.id.inputsearch);
lst = (ListView) findViewById(android.R.id.list);
lst.setBackgroundColor(Color.WHITE);
lst.setCacheColorHint(Color.WHITE);
SimpleAdapter adapter = new SimpleAdapter(this, mylistData,R.layout.simple_list_item2, row, new int[] { R.id.tv1,
R.id.tv2, R.id.tv3, R.id.tv4, R.id.tv5 });
lst.setAdapter(adapter);
inputsearch.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence cs, int start, int before,
int count) {
// String array_sort[]=new String[headlines.length];
adapter.getFilter().filter(cs);
}
public void afterTextChanged(Editable arg0) {
}
public void beforeTextChanged(CharSequence cs, int start,
int before, int count) {
}
});