title: Limit Time Range in Time Picker
body: <p>How to control TimePicker, I just want to show time range in time picker from 08:00 am to 02:00 pm (except from 08:00 am to 02:00 pm hide all)</p>
  
  <p>I have written complete code to show TimePicker, and customized time as well.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>         case DIALOG_TIME:
              final Calendar c = Calendar.getInstance();
              int hour = c.get(Calendar.HOUR_OF_DAY);
              int minute = c.get(Calendar.MINUTE);
  
              // Create a new instance of TimePickerDialog and return it
              return new TimePickerDialog(this, lisTime, hour, minute,
              DateFormat.is24HourFormat(MainActivity.this));
  
          TimePickerDialog.OnTimeSetListener lisTime = new TimePickerDialog.OnTimeSetListener() {
  
          @Override
          public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
              // TODO Auto-generated method stub
              String meridiem = "";
              nim = minute;
              Calendar datetime = Calendar.getInstance();
              datetime.set(Calendar.HOUR_OF_DAY, hourOfDay);
              datetime.set(Calendar.MINUTE, minute);
  
              if (datetime.get(Calendar.AM_PM) == Calendar.AM)
                  meridiem = "AM";
              else if (datetime.get(Calendar.AM_PM) == Calendar.PM)
                  meridiem = "PM";
  
              hour = (datetime.get(Calendar.HOUR) == 0) ?"12":String.valueOf(datetime.get(Calendar.HOUR));
  
              String time = pad(Integer.parseInt(hour)) + ":" + pad(minute) + " " + meridiem;
              editTime.setText(time);
  
          }
      };
  
      private String pad(int value){
  
          if(value&lt;10){
              return "0"+value;
          }
  
          return ""+value;
      }
  </code></pre>