how to add button dynamically to progress dialog android?
<p>I added dynamic message successfully to my progressdialog.But when adding the button it doesn't take the button Please help me out.</p>

<pre><code>private Handler progressHandler = new Handler() {

            @Override
            public void handleMessage(Message msg) {

                // process incoming messages here
                switch (msg.what) {

                case 0:
                    // update progress bar
                    progressDialog.setMessage("" + (String) msg.obj);
                    break;
                case 1:
                    progressDialog.setMessage("" + (String) msg.obj);
                    finish();
                    break;
                case 2:
                    Log.d(TAG,"in case 2.........");
//                  progressDialog.cancel();
                    progressDialog.setMessage("" + (String) msg.obj);
                    progressDialog.setButton("HOME", new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
//                          progressDialog.cancel();
                            finish();

                        }
                    });
                    break;

                }
                super.handleMessage(msg);
            }

        };
</code></pre>

<p>Regards,
Rajendar Are</p>
