2017-05-29 10 views
-4

私はリサイクルアダプターを使用してデータをポップアップしています。位置4,12リサイクルアダプターの位置付けの問題

に:uは位置iが例スクロールダウンしていていても繰り返されているいつか見ることができるように

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

:問題は、私は下にスクロールするときに、同じデータが移入されている例でありますそれは事前に

おかげで、機密であるので、私は、ソースコードを貼り付けることはできません

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 
+0

初めてアダプターを設定したコードを投稿し、後でコードを更新しないで –

+1

コードを更新すると助けがありません。 –

+0

メインの質問にコードを追加 –

答えて

1

あなたのrecyclerviewアダプタでgetItemViewTypeを上書きし、すべてが問題ありません。

@Override 
public int getItemViewType(int position) { 
    return position; 
} 
+0

うまくいきません –

+0

あなたはアダプタコードを貼り付けなければなりません。 – deejay

+0

申し訳ありません。しかし、助けてくれてありがとう –

0

私の推測、仮定のためにあなたがTextViewのたびに更新する必要がbindViewHolder()機能では、recyclerview手段で名前のリストを移入する1つのTextViewを持っています。

は、それ以外の場合のみ、以前のデータを示し、あなたがデータを更新するための条件)(場合は、のTextViewを更新するための代替値の他に条件があるはずがあるとします。

+0

しかし、どうすればそれを避けることができますか? 。私はそれがnullであるかどうかを確認する必要があるので、単純にそれを更新する –

+0

リストから** null **値を削除し、他の方法はありません –

+0

okieが試みます –

関連する問題