0
私は、それがリアルタイムデータベース(firebase)を変更するたびにリストビューで行を強調表示しようとしています。ポジション "1"上の何かを変更するとそのハイライトは正しくなりますが、次は変更されますので、半分正しく動作します。 2つのpositsions(1と2)が強調表示されています。むしろif文の比較(現在のオブジェクトフィールドとCharSequences)が間違っていると思いますが、どのように正しく動作するかわかりません。ListViewが毎回更新されるアンドロイドTextWatcher
public View getView(final int position, View convertView, final ViewGroup parent) {
...
...
public void onTextChanged(CharSequence s, int start, int before, int count) {
if ((user.name.equals(s.toString())) == false) {
finalConvertView.setBackgroundColor(Color.GREEN);
new CountDownTimer(500, 100) {
public void onTick(long millisUntilFinished) {
}
public void onFinish() {
finalConvertView.setBackgroundColor(Color.WHITE);
}
}.start();
}
}