5

I have the ability to make my own popup, with dialogs, but I don't need anything complex. I was wondering if there was a simple function I could call that would make a popup where the user entered text and then return to me that text for use.

Sorta like these popups

But with one where the user would enter text.

Fairly new so if there is something like this I wouldn't mind an example to go with it. Thanks.

1

1 Answer 1

13

If you are using Android native UI, then you can easily create an AlertDialog and add a EditText to the dialog.

EditText et = new EditText(this);
AlertDialog.Builder ad = new AlertDialog.Builder (this);
ad.setTitle ("Type text");
ad.setView(et); // <----
ad.show();
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.