title: How does endless scrolling on Recyclerview is posiible?
body: <p>Main activty.java
  i am using volley library.
  here i am trying to do is load 10 images on  Card views until user reach at the end</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
      private RecyclerView mRecyclerView;
      private RecyclerView.Adapter mAdapter;
      private RecyclerView.LayoutManager mLayoutManager;
      String loginURL="http://*****o.comli.com/rimgid.php";
      RequestQueue requestQueue;
      String[] title=null,url=null;
      int i=0;
      Activity activity= MainActivity.this;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
          mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
          mRecyclerView.setHasFixedSize(true);
          mLayoutManager = new LinearLayoutManager(this);
          mRecyclerView.setLayoutManager(linearLayoutManager);
          mRecyclerView.setItemAnimator(new DefaultItemAnimator());
          linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
          requestQueue = Volley.newRequestQueue(this);
          //output = (TextView) findViewById(R.id.hi);
          JsonObjectRequest jor = new JsonObjectRequest(Request.Method.GET, loginURL,
                  new Response.Listener&lt;JSONObject&gt;() {
                      @Override
                      public void onResponse(JSONObject response) {
  
                          try{
  
                              JSONArray ja = response.getJSONArray("hi");//parsing id and image url
                              title=new String[ja.length()];
                              url=new String[ja.length()];
                              for(int i=0; i &lt; ja.length(); i++){
  
                                  JSONObject jsonObject = ja.getJSONObject(i);
  
                                  // int id = Integer.parseInt(jsonObject.optString("id").toString());
                                  url[i] ="http://developer.andrinfo.comli.com/img/"+ jsonObject.getInt("id")+".jpg";
  
                                  title[i] = jsonObject.getString("name");
  
  
                              }
                              mAdapter = new MyRecyclerViewAdapter(activity,getDataSet(url,title,ja.length()));
                              mRecyclerView.setAdapter(mAdapter);
                             // Toast.makeText(getApplicationContext(),url[2],Toast.LENGTH_SHORT).show();
                              //output.setText(data);
                          }catch(JSONException e){e.printStackTrace();}
                      }
  
                  },
                  new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
                          Log.e("Volley",error.toString());
  
                      }
                  }
          );
          requestQueue.add(jor);
  
          //requestQueue.start();
          // Code to Add an item with default animation
          //((MyRecyclerViewAdapter) mAdapter).addItem(obj, index);
  
          // Code to remove an item with default animation
          //((MyRecyclerViewAdapter) mAdapter).deleteItem(index);
      }
  
  
  
  
      private ArrayList&lt;DataObject&gt; getDataSet(String[] images,String[] headlines,int size) {
         // String[] images = getResources().getStringArray(R.array.images_array);
         //String[] headlines = getResources().getStringArray(R.array.headline_array);
          ArrayList results = new ArrayList&lt;DataObject&gt;();
          for (int index = 0; index &lt; size; index++) {
              DataObject obj = new DataObject(headlines[index],
                      "Secondary " + index);
              obj.setUrl(images[index]);
              //obj.setHeadline(headlines[index]);
              results.add(index, obj);
          }
          return results;
      }
  }
  </code></pre>
  
  <p>my adapter class</p>
  
  <pre><code>public class MyRecyclerViewAdapter extends RecyclerView
          .Adapter&lt;MyRecyclerViewAdapter
          .DataObjectHolder&gt; {
      private static String LOG_TAG = "MyRecyclerViewAdapter";
      private ArrayList&lt;DataObject&gt; mDataset;
      private static MyClickListener myClickListener;
      private String headline;
      private String reporterName;
      private String date;
      private String url;
      private Activity activityContext;
  
      public static class DataObjectHolder extends RecyclerView.ViewHolder
             {
          TextView label;
          TextView dateTime;
          ImageView imageView;
  
          public DataObjectHolder(View itemView) {
              super(itemView);
              label = (TextView) itemView.findViewById(R.id.textView);
              dateTime = (TextView) itemView.findViewById(R.id.textView2);
              imageView=(ImageView)itemView.findViewById(R.id.imageView);
              Log.i(LOG_TAG, "Adding Listener");
              itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                  }
              });
          }
  
      }
  
  
  
      public MyRecyclerViewAdapter(Activity context,ArrayList&lt;DataObject&gt; myDataset) {
          mDataset = myDataset;
          activityContext=context;
      }
  
      @Override
      public DataObjectHolder onCreateViewHolder(ViewGroup parent,
                                                 int viewType) {
          View view = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.cardview, parent, false);
  
          DataObjectHolder dataObjectHolder = new DataObjectHolder(view);
          return dataObjectHolder;
      }
  
      @Override
      public void onBindViewHolder(DataObjectHolder holder, int position) {
          Context context=null;
          holder.label.setText(mDataset.get(position).getmText1());
          holder.dateTime.setText(mDataset.get(position).getmText2());
          Drawable placeholder = holder.imageView.getContext().getResources().getDrawable(R.drawable.placeholder);
          holder.imageView.setImageDrawable(placeholder);
          //new ImageDownloaderTask(holder.imageView).execute(mDataset.get(position).getUrl());
         Picasso.with(activityContext)
                  .load(mDataset.get(position).getUrl())
                  .placeholder(R.drawable.placeholder)
                  .into(holder.imageView);
      }
  
      public void addItem(DataObject dataObj, int index) {
          mDataset.add(index, dataObj);
          notifyItemInserted(index);
      }
  
      public void deleteItem(int index) {
          mDataset.remove(index);
          notifyItemRemoved(index);
      }
  
      @Override
      public int getItemCount() {
          return mDataset.size();
      }
  
      public interface MyClickListener {
          public void onItemClick(int position, View v);
      }
  
  }
  </code></pre>
  
  <p>please help me to do this.
  I want to use the scroll listener with the main activity..</p>