How do I "convert" System.out.println into variable.getText(); android
<p>I have written a Java program which I want to make into an android application, </p>

<p>I have a class called TowersOfHanoi in the java program where output is done this way:</p>

<p>System.out.println("Move disk " + n + " from " + start + " to " + end); </p>

<p>and I have a mainActivity file where I am calling TowersOfHanoi from however I dont know how to change it from system.ouut... to variable.getText.TowersOfHanoi etc and make it work. </p>

<pre><code>MainActivity code: 
       package com.example.towersofhanoiapp;

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

public class MainActivity extends Activity {


    private TowersOfHanoi towersOfHanoi;
    private Button submit;
    static TextView display; 
    private EditText discs;

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

        towersOfHanoi = new TowersOfHanoi(); 
        submit = (Button) findViewById(R.id.btnSubmit);
        display = (TextView)findViewById(R.id.display);
        discs = (EditText)findViewById(R.id.userInput);

        submit.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                String discsString= discs.getText().toString();
                if (!discsString.isEmpty()){
                    int discsInt =Integer.parseInt(discsString);
                    TowersOfHanoi.solve(discsInt,"Peg A", "Peg B", "Peg C");

                }
            }
        });


    }
}
</code></pre>

<p>TowerOfHanoi Method </p>

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

public class TowersOfHanoi {

   public static void solve(int n, String start, String auxiliary, String end) {
       if (n == 1) {
           System.out.println("Move disk "+ n + " from " + start + " to " + end);
       } else {
           solve(n - 1, start, end, auxiliary);
           System.out.println("Move disk " + n + " from " + start + " to " + end);
           solve(n - 1, auxiliary, start, end);
       }
   }
}
</code></pre>