Asynctask is just pulling my listview and its making list item count as1
<p>I am using pulltorefresh listview in my application.when I use asynctask to get the data,somehow my listview itemcount is increased to 1,instead of 0.</p>

<p>Here is my code for pulltorefresh</p>

<pre><code> listView.setOnRefreshListener(new OnRefreshListener() {

//          @Override
            public void onRefresh() {
                // Your code to refresh the list contents goes here
                listView.setAdapter(null);
                scroll=true;
                pic.clear();
                id.clear();
                name.clear();
                msg.clear();
                img.clear();
                profimg.clear();
                objid.clear();
                comment.clear();
                weburl.clear();
                adapter.clear();
                likes.clear();
                like_or_unlike.clear();
                 previousTotal = 0;

//                listView.removeFooterView(footerView);
//              listView.setAdapter(null);
//              scroll=true;
//              notifyDataSetChanged();
//              urlval=0;
                j=0;
                 loading = true;
                webserv="https://graph.facebook.com/me/home?access_token="+accesstoken;
                 doInBack dob=new doInBack();
                     dob.execute(); 

                // doback(webserv);
                    Log.e("hi","doback called");


            }
        });
</code></pre>

<p>I really cant understand why asynTask class is just pushing my list and my listitem count is temporarily becoming 1 for short time.I really cant understand how to control this problem.</p>

<p>Thanks in advance</p>
