java.lang.ClassCastException: android.widget.TextView. Why am I getting this?
<p>for some reason, I am getting a ClassCastException error. I don't really know why.</p>

<p>Thanks in advance, I am a new programmer and any help would really help (no pun intended).</p>

<p>Code:</p>

<pre><code>final EditText answerBox = (EditText) findViewById(R.id.answerBox);
    final Button button = (Button) findViewById(R.id.button);
    final TextView problem = (TextView) findViewById(R.id.problem);
    final TextView status = (TextView) findViewById(R.id.status);
    final TextView num = (TextView) findViewById(R.id.numerator);
    final TextView denom = (TextView) findViewById(R.id.denominator);

    button.setOnClickListener(new OnClickListener()
    {
        private String inputString;
        public void onClick(View v)
        {
            inputString = problem.getText().toString();
            int firstNumber = Integer.parseInt(inputString.substring(0,1));
            int secondNumber = Integer.parseInt(inputString.substring(2,3));
            int correct = firstNumber + secondNumber;

            int input;
            if(!answerBox.getText().toString().equals(""))
                input = Integer.parseInt(answerBox.getText().toString());
            else
                input = -1;
            if(input != -1)
            {   
                if(input == correct)
                {
                    status.setText("Nice! You are correct!");
                    denom.setText(Integer.parseInt(denom.getText().toString()) +1);
                    num.setText(Integer.parseInt(num.getText().toString()) +1);

                }
                else
                {
                    status.setText("Sorry, but your answer was wrong.");
                    denom.setText(Integer.parseInt(denom.getText().toString()) +1);
                }
            }

            int a = (int) (Math.random() * 10);
            int b = (int) (Math.random() * 10);

            String newProblem = Integer.toString(a) + "+" + Integer.toString(b);
            problem.setText(newProblem.toString());
            answerBox.setText("");
        }
    });
</code></pre>

<p>Once again, thanks.</p>

<p>Stuff from LogCat:</p>

<pre><code>10-30 04:04:10.490: ERROR/AndroidRuntime(551): FATAL EXCEPTION: main
10-30 04:04:10.490: ERROR/AndroidRuntime(551): java.lang.RuntimeException: Unable to start    activity ComponentInfo{com.benhsu.Addition/com.benhsu.Addition.AdditionActivity}: java.lang.ClassCastException: android.widget.TextView
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.os.Looper.loop(Looper.java:123)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.ActivityThread.main(ActivityThread.java:3683)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at java.lang.reflect.Method.invokeNative(Native Method)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at java.lang.reflect.Method.invoke(Method.java:507)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at dalvik.system.NativeStart.main(Native Method)
10-30 04:04:10.490: ERROR/AndroidRuntime(551): Caused by: java.lang.ClassCastException: android.widget.TextView
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at com.benhsu.Addition.AdditionActivity.onCreate(AdditionActivity.java:24)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
10-30 04:04:10.490: ERROR/AndroidRuntime(551):     ... 11 more
</code></pre>

<p>XML Layout file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1"&gt;
&lt;TextView  
android:layout_width="fill_parent" 
android:id="@+id/problem" android:layout_height="wrap_content"            android:text="@string/problemString"/&gt;
&lt;EditText android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/answerBox"&gt;
&lt;requestFocus&gt;&lt;/requestFocus&gt;
&lt;/EditText&gt;
&lt;TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/status" android:id="@+id/status"&gt;&lt;/TextView&gt;
&lt;Button android:text="Button" android:layout_height="wrap_content" android:id="@+id/button" android:layout_width="wrap_content"&gt;&lt;/Button&gt;
&lt;RelativeLayout android:id="@+id/relativeLayout1" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_weight="0.14"&gt;
&lt;TextView android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:layout_height="wrap_content" android:layout_alignBottom="@+id/textView1" android:text="@string/score" android:id="@+id/textView2" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_alignBaseline="@+id/textView1"&gt;&lt;/TextView&gt;
&lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/numerator" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_alignParentTop="true" android:layout_toRightOf="@+id/textView2" android:layout_marginLeft="18dp" android:text="@string/numerator"&gt;&lt;/TextView&gt;
&lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/fraction" android:id="@+id/fraction" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_alignParentTop="true" android:layout_toRightOf="@+id/numerator" android:layout_marginLeft="14dp"&gt;&lt;/TextView&gt;
&lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/denominator" android:id="@+id/denominator" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_alignParentTop="true" android:layout_toRightOf="@+id/fraction" android:layout_marginLeft="19dp"&gt;&lt;/TextView&gt;
&lt;/RelativeLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>
