how to show the progress Dialog in Android?
<p>I need to show the progress Message to the user.But i can't able to show that.Here is my code.What's wrong in my code.Guide me to do.</p>

<pre><code>public class MyProgressDemo extends Activity {
/** Called when the activity is first created. */

private Button clickBtn;
public ProgressDialog progressDialog;
Handler handler = new Handler();

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    clickBtn = (Button) findViewById(R.id.Button01);
    clickBtn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            progressDialog = ProgressDialog.show(MyProgressDemo.this, "",
                    "Please Wait");
            processThread();

        }

    });

}

protected void processThread() {

    handler.post(new Runnable() {

        @Override
        public void run() {
            longTimeMethod();
            UI();
            progressDialog.dismiss();
        }
    });

}

private void longTimeMethod() {
    try {
        String strMethod = "MethodName";
        String strUrl = "url";
        String strResponse = WebserviceCall.Mobileaappstore(strUrl,
                strMethod);
        Log.d("RES", strResponse);
    } catch (Exception e) {
        Log.e("Exc", e.getMessage());
    }

}

private void UI() {
    TextView tv = new TextView(this);
    tv.setText("This is new UI");
    setContentView(tv);
}
</code></pre>

<p>}</p>
