In my problem, I have my `MainActivity`, with a `TextView` and `EditText`, and a method, which should send out messages to the `TextView` and receive the content of an `EditText`. The problem is receiving text from the EditText, and making this method wait for the user input

I'll try to post my cropped code so you will gain some knowledge about what I am trying to achieve.

```
public class MainActivity extends Activity {

public class MonitorObject{
}
final MonitorObject mSync = new MonitorObject();
private TextView mConsoleOut;
private EditText mInputLine;
public String inputString;
public synchronized String getInputString(String value){this.inputString = value; return inputString;}

IOHandler IOhandler;

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

    mConsoleOut = (TextView) findViewById(R.id.consoleOut);
    mInputLine = (EditText) findViewById(R.id.actionInField);

    EditText editText = (EditText) findViewById(R.id.actionInField);
    editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            synchronized (mSync){
                mSync.notify();
            }
            return true;
        }
    });
    GameCycle gameCycle = new GameCycle();
    Thread gameloop = new Thread(gameCycle);
    gameloop.start();
}

public class GameCycle implements Runnable{
    public void run(){
        game();
    }
}

public void game(){
findViewById(R.id.actionInField);
    Integer time=0;
    PlayerClass p1 = new PlayerClass(1,4);
    TileClass tile = new TileClass.Forest();
    Integer gamestate=0;

    while(gamestate==0){
        time++;
        tile.initialize_tilesettings(time, p1);
        tile.passed=true;
        List actionResponse=new ArrayList(Arrays.asList("repeat", "type", "returnval"));

        while(gamestate==0 && !actionResponse.get(1).equals("tileChange")){

            actionResponse=Arrays.asList("repeat", "type", "returnval");
            Boolean tileActions = true;

            while(!actionResponse.get(0).equals("continue")){
                //actions to be repeated

                String exe=null;

                tileActions=true;

                List<String> params = new ArrayList<>();

                <<<<<print>>>>>("\nWhat will you do?");

                synchronized (mSync){
                    try {
                        mSync.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

                <<<<<getinput>>>>>String inp=returnInputString();
                String[] splitIn=inp.split(" ");

                for(String text:splitIn){
                    params.add(text.toLowerCase());
                }

                for(ActionClass action:p1.getActions()){
                    if(action.method.contains(params.get(0))){
                        exe=action.method;
                    }
                }

                if(exe==null){
                    <<<<<print>>>>>("Not a valid action");

                    actionResponse=Arrays.asList("repeat","","");
                }
                else{
                    try{
                        actionResponse=p1.excecFunctionByTag(exe, Arrays.asList(p1, tile, params));
                        if(actionResponse==null){
                            throw new RuntimeException();
                        }
                    }
                    catch (Exception e){
                        for(ActionClass action:p1.getActions()){
                            if(exe.equals(action.method)){
                                String actionEnt=action.actionEntry;
                                <<<<<print>>>>>("\nInvalid parameters, try: "+actionEnt);
                                actionResponse=Arrays.asList("repeat","","");
                            }
                        }
                    }
                    return;
                }

            }
        }
        if(gamestate==1){
            <<<<<print>>>>>('You died! Game over!\n\n<-<-< New Game >->->\n\n')
            game();
        }
        else if(gamestate==2){
            <<<<<print>>>>>("You have defeated the boss! Behind the fallen enemy you can see a path. You follow it and find a small village. You are safe!\n\n<-<-< New Game >->->\n\n")
            game();
        }
    }
}

```

I have marked the required input/output methods with `<<<<< >>>>>`.

Have mercy with my java skills, since this is my first large project in java and the whole structure is converted from python.

Again, all help is greatly appreciated.