ListView inside PopupDialog is null
<p>In my application I am trying to use a <code>ListView</code> inside a <code>PopupDialog</code>. This is done inside of an <code>AsyncTask</code>. I think the issue lies somewhere between the <code>onPreExecute</code> and <code>onPostExecute</code>.....everything is returning correctly, but the <code>list = null</code> after I use <code>findViewById()</code>. I can't figure out why......Note, the AsyncTask and Adapter are both inner classes.</p>

<pre><code>    protected void onPreExecute() {
        AlertDialog.Builder alert = new AlertDialog.Builder(CreateNewReport.this);
        LayoutInflater inflater = LayoutInflater.from(CreateNewReport.this);
        popupView = inflater.inflate(R.layout.add_expenses, null);

        alert.setTitle("Add Expenses").setView(popupView);

        alert.setNeutralButton("Save", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int whichButton) {

            }
        });

        alert.show();
    }

    protected void onPostExecute(List&lt;Expense&gt; expenses){
        availableExpenses = expenses;

        // create list adapter for available expenses
        ArrayAdapter&lt;Expense&gt; adapter = new ArrayAdapter&lt;Expense&gt;(CreateNewReport.this,
                android.R.layout.simple_list_item_1, expenses);

        // get a reference to the list
        final ListView list = (ListView) findViewById(R.id.listViewAvailableExpenses);

        // set the list adapter
        list.setAdapter(adapter);

        // find widgets
        final ProgressBar progress = (ProgressBar) findViewById(R.id.loading_expenses);
        final LinearLayout listLayout = (LinearLayout) findViewById(R.id.available_expenses);
        final LinearLayout progressContainer = (LinearLayout) findViewById(R.id.available_expenses_loading);

        // change visibility as needed
        progressContainer.setVisibility(View.INVISIBLE);
        progress.setVisibility(View.INVISIBLE);
        listLayout.setVisibility(View.VISIBLE);
    }
</code></pre>

<p><strong>XML for the popup box</strong></p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" &gt;
    &lt;ProgressBar
         android:id="@+id/loading_expenses"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         style="@android:style/Widget.ProgressBar.Large"
         android:layout_centerInParent="true"
         /&gt;
        &lt;ListView
            android:id="@+id/listViewAvailableExpenses"
            style="@style/Container"
            android:cacheColorHint="#00000000"
            /&gt;
&lt;/RelativeLayout&gt;
</code></pre>
