Ich benutze Recycling-Adapter, um meine Daten zu popultieren. Das Problem ist, wenn ich die gleichen Daten nach unten scrollen, werden aufgefüllt werden Beispiel:Recycle Adapter Positionierung Problem
05-28 20:52:09.626 adding key: setting the holder - position :0 05-28 20:52:10.533 adding key: setting the holder - position :1 05-28 20:52:10.569 adding key: setting the holder - position :2 05-28 20:52:10.916 adding key: setting the holder - position :3 05-28 20:52:11.214 adding key: setting the holder - position :4 05-28 20:52:11.494 adding key: setting the holder - position :5 05-28 20:52:11.789 adding key: setting the holder - position :6 05-28 20:52:12.033 adding key: setting the holder - position :4 05-28 20:52:12.037 adding key: setting the holder - position :5 05-28 20:52:12.041 adding key: setting the holder - position :6 05-28 20:52:12.099 adding key: setting the holder - position :7 05-28 20:52:12.212 adding key: setting the holder - position :8 05-28 20:52:13.052 adding key: setting the holder - position :9 05-28 20:52:13.340 adding key: setting the holder - position :10 05-28 20:52:13.739 adding key: setting the holder - position :11 05-28 20:52:14.185 adding key: setting the holder - position :12 05-28 20:52:14.227 adding key: setting the holder - position :13 05-28 20:52:14.481 adding key: setting the holder - position :14 05-28 20:52:14.851 adding key: setting the holder - position :15 05-28 20:52:15.032 adding key: setting the holder - position :12 05-28 20:52:15.041 adding key: setting the holder - position :13 05-28 20:52:15.044 adding key: setting the holder - position :14 05-28 20:52:15.069 adding key: setting the holder - position :15 05-28 20:52:15.174 adding key: setting the holder - position :16 05-28 20:52:15.843 adding key: setting the holder - position :17 05-28 20:52:16.181 adding key: setting the holder - position :18 05-28 20:52:16.599 adding key: setting the holder - position :19 05-28 20:52:16.631 adding key: setting the holder - position :20 05-28 20:52:16.913 adding key: setting the holder - position :21 05-28 20:52:17.378 adding key: setting the holder - position :22 05-28 20:52:17.693 adding key: setting the holder - position :23 05-28 20:52:18.082 adding key: setting the holder - position :24 05-28 20:52:18.498 adding key: setting the holder - position :25 05-28 20:52:18.844 adding key: setting the holder - position :26 05-28 20:52:19.236 adding key: setting the holder - position :27 05-28 20:52:19.713 adding key: setting the holder - position :28 05-28 20:52:19.926 adding key: setting the holder - position :25 05-28 20:52:19.928 adding key: setting the holder - position :26 05-28 20:52:19.948 adding key: setting the holder - position :27 05-28 20:52:19.972 adding key: setting the holder - position :28 05-28 20:52:20.010 adding key: setting the holder - position :29 05-28 20:52:20.783 adding key: setting the holder - position :30 05-28 20:52:20.995 adding key: setting the holder - position :31 05-28 20:52:21.178 adding key: setting the holder - position :32 05-28 20:52:21.537 adding key: setting the holder - position :33 05-28 20:52:21.908 adding key: setting the holder - position :34 05-28 20:52:22.335 adding key: setting the holder - position :35 05-28 20:52:22.607 adding key: setting the holder - position :33 05-28 20:52:22.609 adding key: setting the holder - position :34 05-28 20:52:22.611 adding key: setting the holder - position :35 05-28 20:52:22.657 adding key: setting the holder - position :36 05-28 20:52:22.891 adding key: setting the holder - position :37 05-28 20:52:23.757 adding key: setting the holder - position :38 05-28 20:52:23.968 adding key: setting the holder - position :39 05-28 20:52:23.996 adding key: setting the holder - position :40 05-28 20:52:24.285 adding key: setting the holder - position :41 05-28 20:52:24.643 adding key: setting the holder - position :42 05-28 20:52:25.134 adding key: setting the holder - position :43 05-28 20:52:25.388 adding key: setting the holder - position :44 05-28 20:52:25.680 adding key: setting the holder - position :45 05-28 20:52:26.050 adding key: setting the holder - position :46 05-28 20:52:26.345 adding key: setting the holder - position :47 05-28 20:52:26.759 adding key: setting the holder - position :48 05-28 20:52:27.060 adding key: setting the holder - position :49 05-28 20:52:27.112 adding key: setting the holder - position :46 05-28 20:52:27.114 adding key: setting the holder - position :47 05-28 20:52:27.116 adding key: setting the holder - position :48 05-28 20:52:27.134 adding key: setting the holder - position :49 05-28 20:52:27.311 adding key: setting the holder - position :50
Wie u irgendwann die Position wiederholt wird sehen, obwohl ich Ex verschiebe nach unten: Position 4,12
ich kann nicht den Quellcode einfügen, weil sie vertraulich
Vielen Dank im Voraus
EDIT:
rv.addOnScrollListener(new EndlessRecyclerOnScrollListener(linearLayoutManager) {
@Override
public void onLoadMore(int current_page) { // when we have reached end of RecyclerView this event fired
if (canMakeRequest()) {
//load more data and notify adapter
}
}
});
//load data and set adapter
Post Ihren Code, wo Sie den Adapter zum ersten Mal und wenn Sie es später –
aktualisieren, ohne Ihren Code ist unmöglich zu helfen. –
Code zur Hauptfrage –