を使用してデータベースから名前をリストしましたが、のメソッドSimpleCursorAdapter
を使用して特定の名前の色を変更したいと思います。SimpleCursorAdapter.ViewBinder
このメソッドの実行中に問題が発生しました。データベースには異なる名前が含まれていますが、ListView
すべての名前が1つの特定の名前として表示されます。私は何が間違っているのですか?特定の名前のテキストの色を変更するにはどうすればよいですか?使用できViewBinder
ますか?
これは私のコードの一部ですViewBinder
:
SimpleCursorAdapter.ViewBinder binder = new SimpleCursorAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
// TODO Auto-generated method stub
String[] temp = dh.return_result();
tv = (TextView)findViewById(R.id.textView1);
tv = (TextView) view;
for(int i = 0; i<temp.length; i++)
{
if(temp[i].equalsIgnoreCase("Ameer Zhann"))
{
tv.setText(temp[i]);
tv.setTextColor(Color.rgb(58, 58, 224));
return true;
}
}
return false;
}
};
これが私の出力画像です:
どうすればこれを解決できますか?