I am designing a text based game and I want it so that when a user enters something in an EditText field, other items on screen update accordingly. I tried doing the following in the onCreate method to no avail (probably because that method is only called when the activity is first created).
How do I actively check if a user inputted something in the field without them pressing a button and only by them typing something in the field?
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Typeface myTypeface;
TextView myTextView;
myTypeface= Typeface.createFromAsset(getAssets(), "fonts/script.ttf");
EditText players = (EditText) findViewById(R.id.id_players);
//while(players.getText().toString().matches("")) {}
if(!players.getText().toString().matches(""))
myTextView.setText(players.getText().toString()); //this is just to debug if it is actually working
}