私はListView
をカスタムアダプタで持っています。ListView
に一致すると1つの文字列を渡して、リスト項目のテキストの色をActivity
から変更します。リストビュー項目のテキストの色と画像の色を変更するには
ここに私のコード:
MyActivity:事前に
public void handleResult(String rawResult) {
if(Utility.isNotNull(rawResult.getText().toString())) {
for(int i=0;i<listView.getAdapter().getCount();i++){
if(rawResult.equals(listItems.get(i).getStockItems())){
// listView.getChildAt(i).setBackgroundColor(ContextCompat.getColor(context, R.color.hint));
/* Here I want to change list item text color*/
adapter.notifyDataSetChanged();
}
}
}
}
ありがとう!
のハンドラの実行を覚えてありがとうございました!!! – appu