title: EditText.SetOnClickListener
body: <p>PatientInfo.Java</p>
  
  <pre><code>public class PatientInfo extends Activity {
  
   private Spinner locationSpinner;
   Calendar myCalendar = Calendar.getInstance();
     EditText edittext = (EditText) findViewById(R.id.DateTextEdit);
  
     DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener() {
  
          @Override
          public void onDateSet(DatePicker view, int year, int monthOfYear,
                  int dayOfMonth) {
              // TODO Auto-generated method stub
              myCalendar.set(Calendar.YEAR, year);
              myCalendar.set(Calendar.MONTH, monthOfYear);
              myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
              updateLabel();
          }
  
      };
  
  
         edittext.setOnClickListener (new OnClickListener() {
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  new DatePickerDialog(classname.this, date, myCalendar
                          .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),
                          myCalendar.get(Calendar.DAY_OF_MONTH)).show();
              }
          });
  
  
            private void updateLabel() {
  
          String myFormat = "MM/dd/yy"; //In which you need put here
          SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);
  
          edittext.setText(sdf.format(myCalendar.getTime()));
          }
  </code></pre>
  
  <p>Activity_patient_info.xml</p>
  
  <pre><code>    &lt;!--  Row 2  --&gt;
  &lt;!-- Date Of Diagnosis Row --&gt;
      &lt;TableRow
      android:id="@+id/tableRow2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:padding="5dip" &gt;
  
      &lt;TextView
          android:id="@+id/DiagnosisTextView"
          android:text="Date of Diagnosis"
          android:textAppearance="?android:attr/textAppearanceSmall" /&gt;
  
        &lt;EditText
          android:id="@+id/DateTextEdit"
       android:layout_width="wrap_content"
      android:layout_height="wrap_content"
    android:editable="false"
     android:focusable="false"
     android:onClick="setOnClickListener"
          android:hint="Choose Date" /&gt;
  
         &lt;Button
      android:id="@+id/btnChangeDate"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Change Date" /&gt;
  
  &lt;/TableRow&gt;
  </code></pre>
  
   
  
  <p>I was able to get my Spinners working such that i'm able to choose the date by tapping on the edittext field. However, i could't get the datepicker working. 
  The error popup was " Syntax error on token "setOnClickListener", = expected after this token"</p>
  
  <p>The above solution was copied and modified from another stakeoverflow page.</p>
  
  <p>Appreciate the help. </p>