在setAdapter前設定setsetHasStableIds(true)
@Override
public long getItemId(int position) {
return list.get(position).getId();
}
需要重寫getItemId(int position)來傳回一個代表每個資料項的唯一ID,如果您沒有一個類似 id 的唯一值,則可以使用字元串上的 hashCode() 來擷取唯一值。結果也是一樣的。
圖檔閃爍也可以這樣設定試試