How to set cancel button in Progress Dialog?
<p>i want to set a cancel button in progress dialog.
This is my code.</p>

<pre><code>myDialog = new ProgressDialog(BaseScreen.this);
            myDialog.setMessage("Loading...");
            myDialog.setCancelable(false);
            myDialog.show();
</code></pre>

<p>I want to set a button with onclickListener on this progress Dialog.
i use this code.</p>

<pre><code>myDialog.setButton("Cancel", new OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub

                myDialog.dismiss();
                }
            });
</code></pre>

<p>But its or similar listeners not working for me.
Kindly suggest me to solve this. </p>
