title: 2 Time picker in Same activity
body: <p>Can anyone help me to implement two time picker in same activity and store its 4 value (hour,minute) into 4 different variables....
  My code is as below (not working)...</p>
  
  <p>public class Time extends AppCompatActivity{</p>
  
  <pre><code>static final int START_TIME_ID=0;
  static final int END_TIME_ID=1;
  
  EditText edit_start_time,edit_end_time;
  
  public int hour,minute;
  private int chour,cminute;
  
  public Time(){
      final Calendar calendar=Calendar.getInstance();
      chour=calendar.get(Calendar.HOUR_OF_DAY);
      cminute=calendar.get(Calendar.MINUTE);
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_Time);
      edit_start_time = (EditText) findViewById(R.id.edit_start_time);
      edit_end_time = (EditText) findViewById(R.id.edit_end_time);
  
  edit_start_time.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              showDialog(START_TIME_ID);
          }
      });
  
      edit_end_time.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v){
              showDialog(END_TIME_ID);
          }
      });
  </code></pre>
  
  <p>}</p>
  
  <pre><code>private TimePickerDialog.OnTimeSetListener mStartTime=new TimePickerDialog.OnTimeSetListener()
  {
      public void onTimeSet(TimePicker view,int hourofday,int min)
      {
          hour=hourofday;
          minute=min;
      }
  };
  
  private TimePickerDialog.OnTimeSetListener mEndTime=new TimePickerDialog.OnTimeSetListener()
  {
      public void onTimeSet(TimePicker view,int hourofday,int min)
      {
          hour=hourofday;
          minute=min;
      }
  };
  
  @Override
  protected Dialog onCreateDialog(int id)
  {
      switch (id)
      {
          case START_TIME_ID:
              return new TimePickerDialog(this,mStartTime,chour,cminute,false);
          case END_TIME_ID:
              return new TimePickerDialog(this,mEndTime,chour,cminute,false);
      }
      return null;
  }
  </code></pre>