title: How to disable keyboard in TimePickerDialog android?
body: <p>I am using timepicker and datepicker in my app. i want to disable keyboard in both these. i am able to disable keyboard in date picker with below code.</p>
  
  <pre><code>datePickerDialog.getDatePicker().setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
  </code></pre>
  
  <p>but not getting how to disable keyboard in timepickerdialog.</p>
  
  <p>i tried below popular example but still no use</p>
  
  <pre><code>public class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener
  {
      private TimePickerDialog timePickerDialog;
  
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState)
      {
          //Default 6:00
          timePickerDialog = new TimePickerDialog(getActivity(), this, 6, 0, android.text.format.DateFormat.is24HourFormat(getActivity()));
  
          return timePickerDialog;
      }
  
      @Override
      public void onStart()
      {
          super.onStart();
  
          final View hourView = timePickerDialog.findViewById(Resources.getSystem().getIdentifier("hour", "id", "android"));
          final View minuteView = timePickerDialog.findViewById(Resources.getSystem().getIdentifier("minute", "id", "android"));
  
          if (hourView != null &amp;&amp; hourView instanceof NumberPicker)
          {
              ((NumberPicker) hourView).setDescendantFocusability(TimePicker.FOCUS_BLOCK_DESCENDANTS);
          }
  
          if (minuteView != null &amp;&amp; minuteView instanceof NumberPicker)
          {
              ((NumberPicker) minuteView).setDescendantFocusability(TimePicker.FOCUS_BLOCK_DESCENDANTS);
          }
      }
  
      @Override
      public void onTimeSet(TimePicker view, int hourOfDay, int minute)
      {
          ((MenuEditActivity) getActivity()).setRecipeTime(hourOfDay, minute);
      }
  
      @Override
      public void onCancel(DialogInterface dialog)
      {
          super.onCancel(dialog);
      }
  }
  </code></pre>
  
  <p>any help?</p>