title: date and time Validation in android using edittext listener
body: <p>I'm having a problem with on click of edit text,I want a date and time picker dialog should pop up on click of edit text.Please help me out.</p>
  
  <pre><code>public  void setstarttime()
      {
          startTimePicker = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {
              public void onTimeSet(TimePicker picker, int hourOfDay, int minute) {
  
                  //set selected time to calender
                  //@author om
                  startTimeCal.set(Calendar.MINUTE, minute);
                  startTimeCal.set(Calendar.HOUR, hourOfDay);
  
                  mStartTimeHour = hourOfDay;
                  mStartTimeMinute = minute;
  
  
                  String am_pm = (hourOfDay &lt; 12) ? "AM" : "PM";
                  starttime.setText(CommonUtil.getFormattedTimeInString(startTimeCal.getTimeInMillis()) + " " + am_pm);
                  // timeValidation(TAG_STARTTIME);
              }
          }, mStartTimeHour, mStartTimeMinute, false);
          startTimePicker.show();
      }
  </code></pre>