ProgressDialog does not disappear in android app
<p>I have an android application which in its main activity, data are adapted from sqlite db and shown in list view. I tried to use Progress dialog to show 'loading' message to user during fetching data from db. But the dialog does not disappear.</p>

<p>Here is the code :</p>

<pre><code>public class BirthdayAlarmActivity extends ListActivity {

    List&lt;BirthdayContact&gt; listofAvailableBirthdays;

    ProgressDialog pDialog;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.birthday_list);


        listofAvailableBirthdays=new ArrayList&lt;BirthdayContact&gt;();

        ReinitializeList();
}

@Override
protected void onResume() {

        ReinitializeList();
}


void ReinitializeList()
    {

        new LoadListView().execute();

            if(listofAvailableBirthdays.size()&gt;0)
        {
            //get ready the adapter
            ArrayAdapter&lt;BirthdayContact&gt; ara=
                     new                 MyArrayAdapter(BirthdayAlarmActivity.this,listofAvailableBirthdays);

            //set the adapter
            setListAdapter(ara);
             }

}

public class LoadListView extends AsyncTask&lt;Void, Void, Void&gt;
{

        //ProgressDialog pDialog;

        @Override
        protected void onPreExecute() {
            // Showing progress dialog before sending http request
            pDialog = new ProgressDialog(
                    BirthdayAlarmActivity.this);
            pDialog.setMessage("Please wait..");
            pDialog.setIndeterminate(true);
            pDialog.setCancelable(false);
            pDialog.show();
        }

        protected Void doInBackground(Void... unused) {
            runOnUiThread(new Runnable() {
                public void run() {
                    // increment current page
                    listofAvailableBirthdays.clear();

                    listofAvailableBirthdays=BirthdayHandler.GetTenBirthDays(BirthdayAlarmActivity.this);
                }
            });
            return (null);
        }       

        protected void onPostExecute(Void unused) {
            // closing progress dialog
            pDialog.dismiss();
        }

    }
</code></pre>
