title: NumberPicker not working inside DialogFragment
body: <p>I'm learning the basics of android programming and having some trouble with a NumberPicker.</p>
  
  <p>I am close to what I want to have, the dialog opens and the hour and minute number pickers appear, but they do not have numbers above and below to scroll through. I also can't edit the numbers with the keyboard that pops up. I tried adding an onValueChange listener, but it didn't generate any events when I used the keyboard.</p>
  
  <p>Can anyone offer advice on how to fix this? I've noticed so far that there are a lot of things I try to do with the widgets in certain activities or fragments that aren't supported in that specific class.</p>
  
  <p>Below are snippets of the relevant code and images:</p>
  
  <p>I have a class ClockActivity with two buttons:</p>
  
  <pre><code>...
  public class ClockActivity extends ActionBarActivity {
  
  ...
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_clock);
  
      // Define gui objects
      ...
      mWorkForTime           = (Button)findViewById(R.id.work_for_time);
      mBreakForTime          = (Button)findViewById(R.id.break_for_time);
  
      // Add listeners for the work for/break for buttons
      mWorkForTime.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              // Bring up the picker fragment
              DialogFragment newFragment = TimePickerFragment.newInstance(R.string.work_title);
              newFragment.show(getSupportFragmentManager(), "WorkTimePicker");
          }
      });
      mBreakForTime.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              // Bring up the picker fragment
              DialogFragment newFragment = TimePickerFragment.newInstance(R.string.break_title);
              newFragment.show(getSupportFragmentManager(), "BreakTimePicker");
          }
      });
      ...
  </code></pre>
  
  <p>The TimePickerFragment class extends the DialogFragment:</p>
  
  <pre><code>public class TimePickerFragment extends DialogFragment {
      // Setup the time pickers
      private NumberPicker mHourPicker;
      private NumberPicker mMinutePicker;
  
      public static TimePickerFragment newInstance(int title) {
          TimePickerFragment fragment = new TimePickerFragment();
          Bundle args = new Bundle();
          args.putInt("title", title);
          fragment.setArguments(args);
          return fragment;
      }
  
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          super.onCreateDialog(savedInstanceState);
  
          int title = getArguments().getInt("title");
  
          LayoutInflater inflater = getActivity().getLayoutInflater();
  
          View view = (View)inflater.inflate(R.layout.activity_time_picker, null);
  
          // Initialize the pickers
          mHourPicker = (NumberPicker)view.findViewById(R.id.hours_picker);
          mMinutePicker = (NumberPicker)view.findViewById(R.id.minutes_picker);
          mHourPicker.setMinValue(0);
          mMinutePicker.setMinValue(0);
          mHourPicker.setMaxValue(24);
          mMinutePicker.setMaxValue(59);
  
  
          Dialog alertDialog = new AlertDialog.Builder(getActivity())
                  .setTitle(title)
                  .setView(inflater.inflate(R.layout.activity_time_picker, null))
                  .setNegativeButton(R.string.negate,
                          new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  ((ClockActivity) getActivity()).doNegativeTimeDialogClick();
                              }
                          })
                  .setPositiveButton(R.string.confirm,
                          new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  ((ClockActivity) getActivity()).doPositiveTimeDialogClick();
                              }
                          })
                  .create();
          return alertDialog;
      }
  }
  </code></pre>
  
  <p>Following is the XML for the DialogFragment view that is in</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;TextView
                  android:layout_width="0dp"
                  android:layout_weight="1"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:text="@string/hours"
                  android:textSize="24sp"
                  android:textStyle="bold"/&gt;
  
              &lt;TextView
                  android:layout_width="0dp"
                  android:layout_weight="1"
                  android:layout_height="wrap_content"
                  android:gravity="center"
                  android:text="@string/minutes"
                  android:textSize="24sp"
                  android:textStyle="bold"/&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;NumberPicker
                  android:id="@+id/hours_picker"
                  android:layout_width="0dp"
                  android:layout_weight="1"
                  android:layout_height="wrap_content"/&gt;
  
              &lt;NumberPicker
                  android:id="@+id/minutes_picker"
                  android:layout_width="0dp"
                  android:layout_weight="1"
                  android:layout_height="wrap_content"/&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is an image of the current operation:</p>
  
  <p><a href="http://i.imgur.com/4UiSLcn.png" rel="noreferrer">http://i.imgur.com/4UiSLcn.png</a></p>
  
  <p>Here is what I'm looking to have:</p>
  
  <p><a href="http://www.i-programmer.info/images/stories/Core/Android/Pickers/ten.gif" rel="noreferrer">http://www.i-programmer.info/images/stories/Core/Android/Pickers/ten.gif</a></p>
  
  <p>Here is some output I see on the console when I try to edit the NumberPicker with the soft keyboard:</p>
  
  <pre><code>01-02 16:10:46.559  18438-18438/com.example.android.worktimer W/IInputConnectionWrapper﹕ beginBatchEdit on inactive InputConnection
  01-02 16:10:46.569  18438-18438/com.example.android.worktimer W/IInputConnectionWrapper﹕ endBatchEdit on inactive InputConnection
  </code></pre>