Setting the listview position to the top
<p>I have a listview declared "android:stackFromBottom="true"" in xml so that it loads the elements bottom up.</p>

<p>I am loading 20 elements from the DB and then adding it to the Listview, and then loading another 20 items when we reach to top while scrolling.</p>

<p>my code snippet:</p>

<pre><code>        myListView.setOnScrollListener(new OnScrollListener() {
        private int lastItem = 0;
        AsyncReadMore task;

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {

        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem,
                int visibleItemCount, int totalItemCount) {

            if (firstVisibleItem == 0 &amp;&amp; totalItemCount &gt; 0
                    &amp;&amp; AppData.messageShown &lt; AppData.TotalMessageCount) {

                lastItem = totalItemCount;
                // mDummy.LoadMessageInBackground(ReplyActivity.this,mMessageAdapter,myListView);
                if (task != null
                        &amp;&amp; task.getStatus() == AsyncTask.Status.RUNNING) {
                    return;
                }

                task = new ReadMore();
                task.execute();
            }
        }
    });
</code></pre>

<p>but, the lisview again comes to the bottom after reloading, I want it to be at the same position where the next 20 elements were added.
I tried listview.setselection(position) after notifydatasetchanged(). but of no use.</p>
