Show a ProgressDialog when user triggers activity start (button press)
<p>I have a class which extends <code>Activity</code> this class job is to get some data from a <code>SQLite</code> database on the phone, and init. a <code>ListView</code> with all the data from the database. </p>

<p>This is the method for getting information from the database:</p>

<pre><code>public ArrayList&lt;Case&gt; getFromDatabase() {

    ArrayList&lt;Case&gt; c = db1.getAllContacts();    
    return c; 
}
</code></pre>

<p>As earlier mentioned this method is inside a class that extends <code>Activity</code> This method is called in the <code>onCreate</code> method. This operation takes about 2 second if the database contains around 15 records. How can I show a ProgressDialog, when user presses the button to start this activity, just to show that something is happening?</p>
