Android ListView in a dialog - nullpointer exception
<p>On a menu item click, I want to pop a dialog box.</p>

<pre><code>private void getAcLookUpDialog() 
 {
try
     {
         Dialog dlg = new Dialog(this); 
         dlg.setContentView(R.layout.aclookup);
         dlg.setTitle(Html.fromHtml("&lt;b&gt;&lt;H2&gt;" + "Select A/C # " + "&lt;/H2&gt;&lt;/b&gt;" ));   
         startManagingCursor(cur); 
         cur = actable.getAllAC();
         Log.d("Testing", "No of AC are " + cur.getCount());
         ListView lv = (ListView) findViewById(R.id.aclookuplist);

         SimpleCursorAdapter adapter1 = new SimpleCursorAdapter (this, R.layout.aclookup_listitem, cur, new String[] {"AC"}, new int[] {R.id.acactext});
         lv.setAdapter(adapter1);
         dlg.show();
     }
     catch(Exception e)
     {
         Log.d("Testing", "In getACLookUpdialog: error is: "+ e.toString());
     }

 }
</code></pre>

<p>It's throwing </p>

<p>12-13 08:58:43.968: DEBUG/Testing(3563): In getACLookUpdialog: error is: java.lang.NullPointerException</p>

<p>The query is getting data. I tried to put diff query which is working in my other app. 
aclookup.xml has a single listview.
aclookup_listitem has a single textview.</p>

<p>What am I doing wrong ?</p>
