Right now I have an EditText with id "getUserName" and a button next to it (both in a linear view) with id "setName" I want someone to be able to click setName, and have the EditText field disappear, the button disappear, and a TextView take it's place. Here's what I have thus far:
public void setName(View view){ EditText editText = (EditText) findViewById(R.id.getUserName); Button button = (Button) findViewById(R.id.setName); TextView textView = (TextView) findViewById(R.id.displayName); String playerName = editText.getText().toString(); ((ViewManager)editText.getParent()).removeView(editText); ((ViewManager)button.getParent()).removeView(button); Log.d("ScoreKeeper", playerName); } So I am successfully removing the desired elements from the screen, but I don't know how to add the textView to take their place.
How can I do that? I'm brand new to Android, so forgive me if this seems ignorant. I've tried looking it up!
Thanks
OPSRCFTW