How to handle progress dialog correctly in android?
<p>I am new in android and java. I am in a trouble in implementing progress dialog correctly.</p>

<p>I have a code like this</p>

<pre><code>   ProgressDialog dialog= new ProgressDialog(Main.this);
   dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
   dialog.setMax(100);
   dialog.show();
   MY METHOD WHICH GRABS DATA FROM INTERNET;
   dialog.dissmiss();
</code></pre>

<p>but by implementing this, my method runs well but no progress dialog is visible, again when i comment out the dismiss method, the dialog doesnt stop and i had to force close the app,then how to use this dialog? in aditional dont want to bring any thread here, is there any way to use dialog without any thread? Thanks</p>
