How to pre select radio button using AlertDialog?
<p>can someone help me with this?  I have an AlertDialog box and its working fine, but what I want is when the alertdialog pops up, it will automatically check one of the radio button. </p>

<p>For an example "10 minutes" is checked when the alertdialog box pops up.</p>

<p>How to do that?</p>

<p>Below is my working code.</p>

<pre><code>final CharSequence[] deleteFilesBy = {"5 minutes","10 minutes", "15 minutes"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.setTitle("Delete Files by?")
                    .setSingleChoiceItems(deleteFilesBy,-1, new DialogInterface.OnClickListener()
                        {   
                            @Override
                            public void onClick(DialogInterface dialog, int which) 
                            {
                                if(deleteFilesBy[which]=="5 minutes")
                                {
                                    // do something
                                }
                                else if (deleteFilesBy[which]=="10 minutes")
                                {
                                    // do something
                                }
                                else if (deleteFilesBy[which]=="15 minutes")
                                {
                                    // do something
                                }
                                dialog.dismiss();
                            }
                        }).setNeutralButton("Cancel", new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface arg0, int arg1) {
                                // TODO Auto-generated method stub
                                arg0.dismiss();
                            }
                        });

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

<p>PLEASE HELP! </p>

<p>Thanks</p>

<p>RJUY</p>
