removeメソッドからオブジェクトを削除する場合:時々getItemViewTypeの位置(INT位置)-1 iはrecylerview
public CustomObject remove(int adapterPos) {
CustomObject customObject = customObjects.remove(adapterPos); //arraylist of custom objects
notifyItemRemoved(adapterPos);
return customObject;
}
そしてgetItemViewType(int position)
内部の位置ではなく、有効な位置の-1
あります。
私はnotifyDataSetChanged();
にnotifyItemRemoved(adapterPos);
を変更した場合の問題は、それが時々動作しますが、また
を生じません。それが機能するとき、正しい項目が削除されます。
何が問題なのですか?また、シナリオにログを追加して明瞭さを少し向上させることができますか? – sumandas