What I want to do is quite simple : to display a dialog form containing an EditText in which the user can specify a message.
So far, I have tried to use the DialogFragmentclass. With the explanations found in the developer’s guide, I have been able to display an alert dialog box showing a message. But I can’t figure out how neither to change the layout of the AlertDialog created to use an XML file of my own or to replace the AlertDialog with a customized class extending the View class for instance.
Am I missing something? Or am I completely on the wrong way?
Thanks in advance for the time you will spend trying to help me.
You absolutely can do this, even using an
AlertDialog!You just have to set a custom layout for the dialog, in
AlertDialogyou would use thesetViewmethod and if you want to use a more generic dialog you can use thesetContentViewmethod.You can take a look at http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog for some more information and an example.
The example in the link provided is contrived without question but it is meant as a stepping stone towards a goal similar to what you are trying to accomplish.
There is a similar question/answer that might be of use to you.