title: Android: Setting EditText/TextView text on Button Press
body: <p>I'm disappointed to have to ask this question because it is something so painfully simply. </p>
  
  <p>On button press, I'm trying to read text from a Time based EditText, perform a calculation, and then set either a second Time based EditText or a TextView to the result of the calculation. Not matter what I try my app continues to crash with the following in the CallStack:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
              at com.timesheethelper.MainActivity.onCalculateClicked(MainActivity.java:48)
  </code></pre>
  
  <p>My code is below:</p>
  
  <pre><code>public void onCalculateClicked(View view)
  {
      //EditText start_ET = (EditText)view.findViewById(R.id.start_editText);
      //EditText end_ET = (EditText)view.findViewById(R.id.end_editText);
      TextView test = (TextView)view.findViewById(R.id.textView);
  
      test.setText("6:30");
  } 
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Calculate"
      android:id="@+id/calculate_button"
      android:layout_below="@+id/end_editText"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="40dp"
      android:onClick="onCalculateClicked" /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="Medium Text"
      android:id="@+id/textView"
      android:layout_alignTop="@+id/end_editText"
      android:layout_alignRight="@+id/calculate_button"
      android:layout_alignEnd="@+id/calculate_button" /&gt;
  </code></pre>
  
  <p>I've spent more time trying to figure out my issue than I care to admit and I'm not expecting it to be something huge. I'm fairly new to Android development so I'm sure its a minor oversight. Any help to point me in the right direction is appreciated!</p>