title: Android button: onClick not working
body: <p>I have the following code in my main activity for an android application that I have been working on. For some reason, whenever I run the app it crashes! My <code>activityMain.xml</code> (a portion of it) is found below, as well as the <code>onClick</code> listener, and the log error.</p>
  
  <pre><code>&lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/calculate"
      android:id="@+id/button"
      android:textSize="20sp"
      android:onClick="calculateScore"
      android:layout_row="0"
      android:layout_column="0"/&gt;
  </code></pre>
  
  <p>I have the following Java code in my main program class:</p>
  
  <pre><code>public void calculateScore(View view) {
      TextView totalScore = (TextView) findViewById(R.id.total);
      totalScore.setText(totalPoints);
  }
  </code></pre>
  
  <p>And I get this error: </p>
  
  <pre><code>Process: org.alexwebber.frc.strongholdcalculator, PID: 8355
  java.lang.IllegalStateException: Could not execute method for android:onClick
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:275)
      at android.view.View.performClick(View.java:5254)
      at android.view.View$PerformClick.run(View.java:21179)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:145)
      at android.app.ActivityThread.main(ActivityThread.java:6895)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
   Caused by: java.lang.reflect.InvocationTargetException
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:270)
      at android.view.View.performClick(View.java:5254) 
      at android.view.View$PerformClick.run(View.java:21179) 
      at android.os.Handler.handleCallback(Handler.java:739) 
      at android.os.Handler.dispatchMessage(Handler.java:95) 
      at android.os.Looper.loop(Looper.java:145) 
      at android.app.ActivityThread.main(ActivityThread.java:6895) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:372) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
   Caused by: android.content.res.Resources$NotFoundException: String resource ID #0xec
      at android.content.res.Resources.getText(Resources.java:1399)
      at android.widget.TextView.setText(TextView.java:4931)
      at org.alexwebber.frc.strongholdcalculator.MainActivity.calculateScore(MainActivity.java:44)
      at java.lang.reflect.Method.invoke(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:372) 
      at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:270) 
      at android.view.View.performClick(View.java:5254) 
      at android.view.View$PerformClick.run(View.java:21179) 
      at android.os.Handler.handleCallback(Handler.java:739) 
      at android.os.Handler.dispatchMessage(Handler.java:95) 
      at android.os.Looper.loop(Looper.java:145) 
      at android.app.ActivityThread.main(ActivityThread.java:6895) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:372) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
  </code></pre>
  
  <p>For some reason, it cant get to the <code>onClick</code> method. Any help would be much appriceated!</p>