title: How to maintain listview scroll position after deleting items from beginning
body: <p>I am trying to delete few elements from the beginning of my listview adapter when elements number is big, for memory efficiency, I want to maintain the same visible elements, but this is not happening due to the deletion
  the following is the corresponding code</p>
  
  <pre><code>listView.setOnScrollListener(new OnScrollListener() 
          {
  
          @Override
          public void onScroll(AbsListView view, int firstVisibleItem,
                  int visibleItemCount, int totalItemCount) 
          {
              synchronized(loadLock)
              {
                  if(totalItemCount&gt;0)
                  {
  
                      if(totalItemCount-firstVisibleItem-visibleItemCount&lt;10 &amp;&amp; offset!=highOffset &amp;&amp;load)
                      {
                          load=false;
                          offset=highOffset;
                          loadEvents();
                      }
                  }
              }
          }
      });
  }
  
  public void loadEvents() 
  {
          Response.Listener&lt;JSONObject&gt; response = new Response.Listener&lt;JSONObject&gt;() 
          {
              @Override
              public void onResponse(JSONObject response)
              {
                  Log.d(TAG, response.toString());
                  JSONArray events = null;
                  try 
                  {
                      events = response.getJSONArray("events");
                  } 
                  catch (JSONException e1) 
                  {
                      e1.printStackTrace();
                  }
                  if (events != null)
                  {
                      Event event;
                      for (int i = 0; i &lt; events.length(); i++) 
                      {
                          //filling events list
                      }
                      highOffset+=events.length();
                      adapter.notifyDataSetChanged();
                      cleanListView();
                      load=true;
                  }
              }
          };
  
  
          CustomRequest eventReq = new CustomRequest(Method.POST, URL, params,
                  response, errorListener);
          AppController.getInstance().addToRequestQueue(eventReq);
      }
  
  public void cleanListView()
      {
          if(eventsList.size()&gt;=1000)
          {
          for(int i=0;i&lt;100;i++)
          {
              eventsList.remove(0);
              adapter.notifyDataSetChanged();
          }
          lowOffset+=100;
      }
  }
  </code></pre>