title: The constructor TimePickerDialog is undefined
body: <p>I want to develop simple alarm application using <code>timePickerDialog</code>. The problem is the constructor TimePickerDialog is undefined on <code>extends fragment</code>.</p>
  
  <p>What should I do? Any suggestions ?</p>
  
  <p>Please help me. Thank you for your concern. </p>
  
  <p>Here is part of the code.</p>
  
  <pre><code>   public class ReminderFragment extends Fragment {
  
     @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
      View v = inflater.inflate(R.layout.fragment_reminder, container, false);
  
      textAlarmPrompt = (TextView) v.findViewById(R.id.alarmprompt);
  
      buttonstartSetDialog = (Button) v.findViewById(R.id.startSetDialog);
      buttonstartSetDialog.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v) {
              textAlarmPrompt.setText("");
              openTimePickerDialog(false);
  
          }});
       return v;
     }
  
     private void openTimePickerDialog(boolean is24r){
      Calendar calendar = Calendar.getInstance();
  
      timePickerDialog = new TimePickerDialog(
              ReminderFragment.this, 
              onTimeSetListener, 
              calendar.get(Calendar.HOUR_OF_DAY), 
              calendar.get(Calendar.MINUTE), 
              is24r);
      timePickerDialog.setTitle("Set Alarm Time");  
  
      timePickerDialog.show();
  
          }
  
       OnTimeSetListener onTimeSetListener= new OnTimeSetListener(){
  
      @Override
      public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
  
          Calendar calNow = Calendar.getInstance();
          Calendar calSet = (Calendar) calNow.clone();
  
          calSet.set(Calendar.HOUR_OF_DAY, hourOfDay);
          calSet.set(Calendar.MINUTE, minute);
          calSet.set(Calendar.SECOND, 0);
          calSet.set(Calendar.MILLISECOND, 0);
  
          if(calSet.compareTo(calNow) &lt;= 0){
              //Today Set time passed, count to tomorrow
              calSet.add(Calendar.DATE, 1);
          }
  
          setAlarm(calSet);
      }};
     }
  </code></pre>