title: RecyclerView pagination does not load properly?
body: <p>I need to do pagination for recyclerview. That load 20 data firstly. After scroll, it must load 20 data more. But it load this 20 data as a new list and delete old 20 data. How can add them end of first 20? I tried some different ways but I couldn't get JsonArray succesfully.</p>
  <pre><code> FirstFragment.java
  
   public class FirstFragment extends Fragment {
          RecyclerView recyclerView;
          private ArrayList&lt;UserOrder&gt; userOrders;
          OrderByPointsAdapter orderByPointsAdapter;
          ProgressBar progressBarMain, progressBarRecy;
          private NestedScrollView nestedScrollView;
          private int xo=0,yo=20;
  
      @Override
      public void onAttach(@NonNull Context context) {
          super.onAttach(context);
      }
  
      @Nullable
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.row_first, container, false);
          progressBarRecy = view.findViewById(R.id.progressBarFirstRecy);
          nestedScrollView = view.findViewById(R.id.nestedRowFirst);
          recyclerView = view.findViewById(R.id.recyclerFirstRow);
          recyclerView.setHasFixedSize(true);
          RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity().getApplicationContext());
          recyclerView.setLayoutManager(layoutManager);
          loadRecycler(xo,yo);
          nestedScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
              @Override
              public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
                  if (scrollY == v.getChildAt(0).getMeasuredHeight() - v.getMeasuredHeight()){
                      xo = xo+20;
                      yo = yo +20;
                      progressBarRecy.setVisibility(View.VISIBLE);
                      loadRecycler(xo, yo);
  
                  }
              }
          });
          return view;
      }
  
      private void loadRecycler(int xo, int yo) {
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(&quot;http://192.168.0.35/&quot;)
                  .addConverterFactory(GsonConverterFactory.create())
                  .build();
          //RequestInterface ekliyoruz
          RequestInterface request = retrofit.create(RequestInterface.class);
          Call&lt;JsonResponse&gt; call = request.getJSON(String.valueOf(xo),String.valueOf(yo));
          call.enqueue(new Callback&lt;JsonResponse&gt;() {
              @Override
              public void onResponse(Call&lt;JsonResponse&gt; call, Response&lt;JsonResponse&gt; response) {
                  if (response.isSuccessful() &amp;&amp; response.body()!= null){
                      progressBarRecy.setVisibility(View.GONE);
                      JsonResponse jsonResponse = response.body();
                      userOrders = new ArrayList&lt;&gt;(Arrays.asList(jsonResponse.getUserOrders()));
                      orderByPointsAdapter = new OrderByPointsAdapter(userOrders,getActivity().getApplicationContext());
                      recyclerView.setAdapter(orderByPointsAdapter);
              }
          }
          });
      }
  </code></pre>