I'm currently making a very simple math game. In this math game I want the player to solve easy equations. It looks like this: 9 \* \_\_ = 45, the player then fill in the correct number to solve the equation and then presses a Correct-button. If correct scores are added to the player.

The empty space is an EditText and the others are TextViews. Because I use a mix of TextView & EditText I need somehow to make a convertion for the program to be able to read and calculate. I've been reading like crazy and tried all kinds of different methods without success. How should I do to get around this?

This is how my data looks like:

**activity\_play.xml**

```
 <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/activity_play"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="com.example.android.laboration2.PlayActivity">

        <TextView
            android:id="@+id/textPlayMultiply"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignTop="@+id/textPlayNumber1"
            android:layout_centerHorizontal="true"
            android:text="@string/multiply"
            android:textAlignment="textStart"
            android:layout_gravity = "start"
            android:textColor="@android:color/black"
            android:textSize="40sp" />

        <TextView
            android:id="@+id/textPlayNumber1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignEnd="@+id/textPlayScore"
            android:layout_alignParentTop="true"
            android:layout_alignRight="@+id/textPlayScore"
            android:layout_marginTop="48dp"
            android:text="@string/number_1"
            android:textAlignment="center"
            android:textColor="@android:color/black"
            android:textSize="50sp" />

        <TextView
            android:id="@+id/textPlayEqual"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/equal"
            android:textAlignment="center"
            android:textColor="@android:color/black"
            android:textSize="50sp"
            android:layout_below="@+id/editTextPlayNumber2"
            android:layout_alignLeft="@+id/textPlayMultiply"
            android:layout_alignStart="@+id/textPlayMultiply" />

        <TextView
            android:id="@+id/textPlayResult"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="29dp"
            android:text="@string/result_number3"
            android:textAlignment="center"
            android:textColor="@android:color/black"
            android:textSize="50sp"
            android:layout_below="@+id/textPlayEqual"
            android:layout_alignLeft="@+id/textPlayEqual"
            android:layout_alignStart="@+id/textPlayEqual" />

        <TextView
            android:id="@+id/textPlayScore"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="31dp"
            android:layout_toStartOf="@+id/answerButton"
            android:text="@string/score_0"
            android:textAlignment="textStart"
            android:layout_gravity="start"
            android:textColor="@android:color/black"
            android:textSize="24sp"
            android:layout_toLeftOf="@+id/answerButton" />

        <Button
            android:id="@+id/answerButton"
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="36dp"
            android:background="@android:color/holo_orange_dark"
            android:text="@string/button_result"
            android:textAllCaps="false"
            android:textColor="@android:color/white"
            android:textSize="18sp"
            android:textStyle="bold"
            android:layout_below="@+id/textPlayResult"
            android:layout_centerHorizontal="true" />

        <EditText
            android:id="@+id/editTextPlayNumber2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@+id/textPlayMultiply"
            android:layout_alignBottom="@+id/textPlayMultiply"
            android:layout_marginLeft="16dp"
            android:layout_marginStart="16dp"
            android:layout_toEndOf="@+id/answerButton"
            android:layout_toRightOf="@+id/answerButton"
            android:hint="    "
            android:inputType="number"
            android:textAlignment="center"
            android:textColor="@android:color/black"
            android:textSize="50sp" />

        <TextView
            android:id="@+id/textPlayLevel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@+id/textPlayScore"
            android:layout_alignBottom="@+id/textPlayScore"
            android:layout_toEndOf="@+id/answerButton"
            android:layout_toRightOf="@+id/answerButton"
            android:text="@string/level_0"
            android:textAlignment="center"
            android:textColor="@android:color/black"
            android:textSize="24sp" />

    </RelativeLayout>

```

.

**PlayActivity.java**

```
package com.example.android.laboration2;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.TextView;

    public class PlayActivity extends AppCompatActivity implements View.OnClickListener {

        TextView textPlayNumber1;
        EditText editTextPlayNumber2;
        TextView textPlayResult;
        TextView textPlayScore;
        TextView textPlayLevel;
        Button answerButton;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_play);

            textPlayNumber1 = (TextView) findViewById(R.id.textPlayNumber1);
            editTextPlayNumber2 = (EditText) findViewById(R.id.editTextPlayNumber2);
            textPlayResult = (TextView) findViewById(R.id.textPlayResult);
            textPlayScore = (TextView) findViewById(R.id.textPlayScore);
            textPlayLevel = (TextView) findViewById(R.id.textPlayLevel);

            answerButton = (Button) findViewById(R.id.answerButton);
            answerButton.setOnClickListener(this);

        }//onCreate ends here

        @Override
        public void onClick(View v) {

        }//onClick ends here

    }//PlayActivity ends here

```