how to prevent dialog to cancel automatically
<p>I have created an dialog..now what i want is that onclick of ok button of my dialog i dont want it to close..but here it is automatically close..so how can i prevent the dialog to close automatically..the code i have written is..</p>

<pre><code>                    AlertDialog.Builder startDialog = new AlertDialog.Builder(this);

                    TextView txtStrtDialogTitle = new TextView(this);
                    txtStrtDialogTitle.setText(res.getString(R.string.strt_dialog_title));
                    txtStrtDialogTitle.setBackgroundResource(R.drawable.strt_dlg_tlt_bckgrnd);
                    txtStrtDialogTitle.setGravity(Gravity.CENTER);
                    txtStrtDialogTitle.setTextColor(Color.WHITE);
                    txtStrtDialogTitle.setTextSize(20);         

                    TextView txtStrtDialogDesc = new TextView(this);
                    txtStrtDialogDesc.setText(Html.fromHtml(res.getString(R.string.strt_dialog_desc)));
                    txtStrtDialogDesc.setPadding(10, 10, 10,10);
                    txtStrtDialogDesc.setBackgroundResource(R.drawable.strt_dlg_desc_bckgrnd);
                    txtStrtDialogDesc.setGravity(Gravity.CENTER);
                    txtStrtDialogDesc.setTextColor(Color.WHITE);
                    txtStrtDialogDesc.setTextSize(15);

                    startDialog.setCustomTitle(txtStrtDialogTitle);
                    startDialog.setView(txtStrtDialogDesc);

                    startDialog.setPositiveButton("Ok", new DialogInterface.OnClickListener()
                    {                                   
                        public void onClick(DialogInterface dialog, int id){
                        txtStrtDialogTitle.setText("SET PASSWORD"); }
                    });

                    AlertDialog alert = startDialog.create();
                    alert.show();
</code></pre>
