onclick i get null
<p>ok i want my script to give me an answer on the first click but it takes me multiple clicks.</p>

<pre><code>`package com.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class EquationsActivity extends Activity {
    EditText field1;
    EditText field2;
    EditText field3;
    EditText field4;
    TextView text1;
    TextView text2;
    TextView text3;
    String fnum;
    String snum;
    String tnum;
    String ftnum;
    String RAnswer;
    String Answer;
    String answer;
    double num7;
    double num8;
    double num9;
    double num10;
    double num5;
double num4;
double num3;
double num6;
double num1;
double num2;
double num11;
double num12;
double num13;
double num14;
double num15;
String num16;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button button1 = (Button) findViewById(R.id.button1);
    field1 = (EditText) findViewById(R.id.tf1);
    field2 = (EditText) findViewById(R.id.tf2);
    field3 = (EditText) findViewById(R.id.tf3);
    field4 = (EditText) findViewById(R.id.tf4);
    text1 = (TextView) findViewById(R.id.text1);
    text2 = (TextView) findViewById(R.id.text2);
    text3 = (TextView) findViewById(R.id.text3);
    button1.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View v) {
            text1.setText(RAnswer);
            text2.setText(Answer);
            text3.setText(answer + "," + num16);
            fnum = field1.getText().toString();
            snum = field2.getText().toString();
            tnum = field3.getText().toString();
            ftnum = field4.getText().toString();
            RAnswer = Double.toString(num7);
            Answer = Double.toString(num11);
            answer = Double.toString(num14);
            num16 = Double.toString(num15);
            num1 = Double.parseDouble(fnum);
            num2 = Double.parseDouble(snum);
            num3 = Double.parseDouble(tnum);
            num4 = Double.parseDouble(ftnum);
            num5 = num2 - num1;
            num6 = num4 - num3;
            num7 = num6 / num5;

            num8 = Math.pow(num2-num1,2);
            num9 = Math.pow(num4-num3, 2);
            num10 = num8+num9;
            num11 = Math.sqrt(num10);

            num12 = num1+num2;
            num13 = num3+num4;
            num14 = num12/2;
            num15 = num13/2;
        }
});
</code></pre>

<p>}
}`</p>
