How to dismiss the progress bar
<p>In my app there is a button that onClick moves you to a new activity with rss news.<br/>I want to use a progress bar until the news are downloaded to the device...<br/>I have make some tries but unfortunately the progress bar is starting until the rss load,when they present it stops but when i return to the previous activity with the android back button, the progress bar starts again and never stops..</p>

<p>I have entered the progress bar in the onClick of the button in my first activity:</p>

<pre><code>Button nea = (Button) findViewById(R.id.nea);
    nea.setOnClickListener(new View.OnClickListener() {
        public void onClick (View view) {


              Thread thread =  new Thread(null, null, "MagentoBackground");
                thread.start();
                m_ProgressDialog = ProgressDialog.show(main.this,    
                      "Please wait...", "Retrieving data ...", true);


            Intent myIntent = new Intent(view.getContext(), nea.class);
            startActivityForResult(myIntent, 0);


        }  

    });
</code></pre>

<p>Where should I put something like <code>m_ProgressDialog.dismiss();</code></p>
