Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 379
TheMangaStand Avatar asked Dec 15 '22 02:12

TheMangaStand


1 Answers

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();
like image 124
align Avatar answered Dec 16 '22 15:12

align