-4

I'm developing an android application, I want a button to appear with the button text being whatever the user inputs into a text field. Confused on how to achieve this.

2
  • Try searching for a tutorial online, something like this: stackoverflow.com/questions/11154898/… Commented Jan 22, 2018 at 21:28
  • This question is unrelated to the Atom editor, so there's no need to add a tag for it. Commented Jan 23, 2018 at 13:29

1 Answer 1

0

lets take an example that you have two buttons defined in the xml one to click on and one to appear later. make the second button invisible using the android:visibilty=invisible and then in the click listener of the first button do something like this.

yourbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
          String incomingText =  yourEditText.getText().toString();
          invisibleButton.setText(incomingText);
          invisibleButton.setVisibility = View.VISIBLE
            }
        });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.