title: I want to change two edit text value on time picker selection
body: <p>I have two edit text in my app and I want to call time picker on their focus and I am successful in calling time pickers on both the edittext but want to add different time on both the edit text filed.
  I have start time edit text and end time edit text. I am mentioning my code.</p>
  
  <pre><code>public class AccessWeekDays extends Activity 
  {
      String message_selectedWeekDay;
      TextView tvAdd;
      TextView tvEdit;
      TextView tvCurrentDay;
  
      EditText edSub;
      EditText edDesc;
      EditText edStartTime;
      EditText edEndTime;
      TimePicker timepicksubject;
  
      int phour;
      int pminute;
      Calendar calendar;
  
          //listenner for start time
  
                  private TimePickerDialog.OnTimeSetListener mTimeSetListener =
                          new TimePickerDialog.OnTimeSetListener() {
                              public void onTimeSet(TimePicker view, int hourOfDay, int minute) 
                              {
                                  /*Date d=new Date();
                                  String myformat="hh:mm:a";
                                  SimpleDateFormat sdf = new SimpleDateFormat(myformat);
                                  //String  formated_time = sdf.format(calendar.getTime());
                                  String  formated_time = sdf.format(d);*/
                                  phour = hourOfDay;
                                  pminute = minute;
                                  updateDisplaystart();
  
                              }
  
                  private void updateDisplaystart() 
                  {
  
                      edStartTime.setText(new StringBuilder()
                  .append(pad(phour)).append(":")
                  .append(pad(pminute)));
  
                  }
  
  
                  private String pad(int c) 
                  {
  
                       if (c &gt;= 10)
                              return String.valueOf(c);
                          else
                              return "0" + String.valueOf(c);
                  }
              };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) 
      {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.adding_timtable_part);
  
           calendar=Calendar.getInstance();
  
          tvAdd=(TextView)findViewById(R.id.textAdd);
          tvEdit=(TextView)findViewById(R.id.textEdit);
          tvCurrentDay=(TextView)findViewById(R.id.textCurentDay);
  
  
          edSub=(EditText)findViewById(R.id.edSubjectname);
          edDesc=(EditText)findViewById(R.id.edDesc);
          edStartTime=(EditText)findViewById(R.id.edStartTime);
          edEndTime=(EditText)findViewById(R.id.edEndTime);
  
          timepicksubject=(TimePicker)findViewById(R.id.timePickersubject);
  
          edSub.setVisibility(View.GONE);
          edDesc.setVisibility(View.GONE);
          edStartTime.setVisibility(View.GONE);
          edEndTime.setVisibility(View.GONE);
  
          Intent intent = getIntent();
          message_selectedWeekDay=intent.getExtras().getString("selectedweekdays");
  
          setCurrentDay();
  
  
          tvAdd.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
  
                  tvAdd.setText("Done");
                  tvEdit.setText("Cancel"); 
  
                  edSub.setVisibility(View.VISIBLE);
                  edDesc.setVisibility(View.VISIBLE);
                  edStartTime.setVisibility(View.VISIBLE);
                  edEndTime.setVisibility(View.VISIBLE);
  
              }
          });
  
  
  
          edStartTime.setOnFocusChangeListener(new OnFocusChangeListener() {
  
              @Override
              public void onFocusChange(View v, boolean hasFocus) {
                  showDialog(1);
  
              }
          });
  
          edEndTime.setOnFocusChangeListener(new OnFocusChangeListener() {
  
              @Override
              public void onFocusChange(View v, boolean hasFocus) {
                  showDialog(1);
  
              }
          });
  
      }//oncreate ends 
  
  
      @Override
      @Deprecated
      protected Dialog onCreateDialog(int id) 
      {
           switch (id) 
           {
  
                   case 1:
  
                       return new TimePickerDialog(this, mTimeSetListener, phour, pminute,false);
                      // return new TimePickerDialog(context, callBack, hourOfDay, minute, is24HourView)
  
  
                   default: 
                           break;
             }
                               return null;
          }
  </code></pre>
  
  <p>I am calling <strong>updateDisplaystart()</strong> method which writes the value of edit text and tell me how I can change the end time edit text value..</p>