title: dialog box with radio button and validate button
body: <p><img src="https://i.stack.imgur.com/YWpok.png" alt="enter image description here"><br>
  I want to add a button centered below the two radio second radio button B and when i checked an option and click on validate, an action take place. Any help please</p>
  
  <pre><code>final CharSequence[] photo = {"A","B"};
  
  AlertDialog.Builder alert = new AlertDialog.Builder(this);
  
  alert.setTitle("Select Gender");
  
  alert.setSingleChoiceItems(photo,-1, new 
  
  DialogInterface.OnClickListener()
  
  {
  
      @Override
      public void onClick(DialogInterface dialog, int which) 
      {
          if(photo[which]=="A")
  
          {
  
              gen="B";
          }
  
          else if (photo[which]=="B")
  
          {
  
              gen="B";
  
          }
      }
  
  });
  alert.show();
  </code></pre>