title: Can't choose number from NumberPicker
body: <p>I have a problem with NumberPicker. I've created a Dialog in which I want to put a NumberPicker. The NumberPicker displays, but I can't change a number in it. I've set MinValue and MaxValue and I can't figure aout what the problem is.</p>
  
  <h3>SettingsDialogFragment.java</h3>
  
  <pre><code>public class SettingsDialogFragment extends DialogFragment{
  
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          LayoutInflater inflater = getActivity().getLayoutInflater();
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  
          builder.setTitle(R.string.settings);
          builder.setView(inflater.inflate(R.layout.settings_dialog, null))
              .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int id) {
                     }
                 })
              .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int id) {
                     }
                 });
          final NumberPicker np = (NumberPicker) inflater.inflate(R.layout.settings_dialog, null).findViewById(R.id.weight_picker);
          np.setMaxValue(300);
          np.setMinValue(0);
          np.setWrapSelectorWheel(true);
          np.setOnValueChangedListener(( new NumberPicker.
          OnValueChangeListener() {
              public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
                  Log.i("value is",""+newVal);
              }
          }));
          return builder.create();
      }
  }
  </code></pre>
  
  <h3>settings_dialog.xml</h3>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical" &gt;
      &lt;NumberPicker 
          android:id="@+id/weight_picker"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
  
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <h3>Screenshot</h3>
  
  <p><img src="https://i.stack.imgur.com/SbKyC.png" alt="screenshot with dialog and numberpicker"></p>