title: AlertDialog with NumberPicker rendered incorrectly
body: <p>I' have a problem about 'rendering' with my NumberPicker inside an AlertDialog.<br>
  I show to you the code:</p>
  
  <pre><code>                //setup del dialog
                  AlertDialog.Builder builder = new AlertDialog.Builder(activity);
                  builder.setCancelable(false);
  
                  final NumberPicker picker = new NumberPicker(activity);
                  picker.setMinValue(0);
                  picker.setMaxValue(5);
                  //set bottoni dialog
                  builder.setPositiveButton(R.string.dialog_btn_seleziona, seleziona);
                  builder.setNegativeButton(R.string.dialog_btn_annulla, null);
  
                  //visualizzo il dialog
                  Dialog dialog = builder.create();
                  dialog.show();
  </code></pre>
  
  <p>the problem is that instead of to have a result like this:<br>
  <img src="https://i.stack.imgur.com/BNbWt.png" alt="enter image description here">
  <br><br>I have this result:<br><img src="https://i.stack.imgur.com/w7o4Z.png" alt="enter image description here">
  <br>The blue line selector is too long, i would like the same lenght of the first picture<br>i founded this topic:<br><a href="https://stackoverflow.com/questions/23857623/numberpicker-rendered-incorrectly-in-a-dialog">NumberPicker rendered incorrectly in a Dialog</a><br>
  that explain how to fix this problem, and the solution is:<br><br>
  instead of this</p>
  
  <pre><code>android:layout_width="match_parent"
  </code></pre>
  
  <p>You should use</p>
  
  <pre><code>android:layout_width="wrap_content"
  android:layout_gravity="center"
  </code></pre>
  
  <p>the problem is that i dont have a layout (made by myself for this numberpicker) so i need to set this parameters programmatically, but i don't know how.</p>