TheMangaStand
TheMangaStand

Reputation: 303

Xamarin Android Simple Input Text Popup

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.

Upvotes: 5

Views: 5989

Answers (1)

align
align

Reputation: 361

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();

Upvotes: 13

Related Questions