Android custom dialog - Create Android Alertdialog with a custom layout

  • 🎬 Video
  • ℹ️ Published 7 years ago
preview_player
UC8wUjFMSX_anYXmZ96NGcfg

In this tutorial you will learn how to create Android custom dialog. We will start first by creating AlertDialog using AlertDialog builder, and then we will design an XML resource layout file that we will use later for the custom alertdialog.


Social media:

💬 Comments
Author

You are different to most teachers on YouTube. And that is a good thing.
People teaching how to do stuff often forget to explain why they are writing this piece of code, you explain it all. AND It's great.

I've subscribed + thanks!

Author — Miles2Code

Author

Ajudou muito, muito obrigado pela explicação simples e efetiva, me inscrevi no canal para acompanhar as novidades.

Author — luan muruk

Author

Thank you so much! This tutorial was very intuitive, easy to follow, and easily applied to other situations. I used it with a ListView.

Author — Daniel

Author

Apart from learning how to create a custom layout for an alert dialog, I also learned the shortcut to convert a string to a string resource. Good work!

Author — Shahood ul Hassan

Author

Great video!

Just one question. I changed the font on my edit texts from the custom dialog layout, but I want to change the font of the dialog title and the positive/negative buttons. Is there a way to do that? Also I would like to create a radius for the dialog box!
Thank you

Author — Danai Kamvoussiora

Author

You could use preview rather than going to design view every time to check the design.

Author — Anupam Prakash

Author

My biggest complaint with this video is that it does not show you any useful use case for the button. For example, how do you get the login button to close the dialog on success? (Showing a toast is pretty useless imo), How do I get and set the values of these editTexts? Though it's just a case of accessing their variables it would make this video complete

Author — Rowan Berry

Author

Valeu amigo. Me ajudou muito. Obrigado

Author — Anderson Nogueira

Author

Thank you soo much! I spent long long time trying to understand why I couldnt access my views without relating them into the inflate Layout using mView ! And then Bingo, finally I found your video and you helped me a lot with this!

Author — Aline Pasquali

Author

i really love your tutorials easy to learn . thanks for this :)

Author — maribel maligno

Author

Thanks very much for the great tutorial. I still wonder how I can wait
for the dialog to be dismissed and then access and use the input for
Email and Password? That would help me a lot!

Author — A. Meier

Author

Awesome job dude! You explain very well

Author — Joseph Maclen

Author

Thank you this is easy than I expected

Author — _Mohamed WS_

Author

Thanks A LOT !! You saved me with this!

Author — Guilherme Pellegrini

Author

What if we don't create a custom Login button and instead set a positive button and set an OnClickListener with it? I'm implementing in this way where user has to enter a name and hit the Save button but there is a problem. I want to keep the user within the dialog if they don't enter anything. However, the dialog disappears as soon as the save button is clicked, whether or not any text is entered. What would i be doing wrong?

Author — Shahood ul Hassan

Author

Thanks! this one is very helpful. and you just got one new subscriber :)

Author — Erdinanda Pandu

Author

Great explaining and good example. Great job! I feel like am watching paid content.

Author — Marko Novakovic

Author

Really an awesome explaination, w want more tutorial from you, thanks

Author — Yatin Zanny

Author

Thank you for this tutorial, it really helped me out.

Author — Roli

Author

Hello sir. i had a query. If i wanted the button on the dialog to redirect me to a different page how do i implement it? For example if i had a modify button on the dialog which takes me to a different page, how will it work?

Author — K G