listing a listview is taking too much time and memory in android
<p>i 3 classes, one which contains the list view and is the acitivity. second class is a adapter that i have built to populate the listview. third class which interacts with the database and gives info to the second class.</p>

<p>the functioning of all the three classes when i do the following:</p>

<p><code>listview.setAdapter(new CustomAdapter())</code></p>

<p>it is taking a whole of time because there are many records to display. 
i want to use multithreading over here.
how do i go about it?
i know of <code>AsyncTask</code>. would it work if i kept the above mentioned statement in the <code>doInBackground()</code> method, but how will i know when the list is populated?</p>

<p>SOLUTION:</p>

<p>Got a solution. i am passing the progressdialog object from the mainactivity class into the custom adapter. over there in the <code>getView</code> method i am checking whether the int arg0 (the variable giving the position in the dataset) has reached the end. upon this i dismiss the progressdialog that i have passed.</p>
