In this blog, we are going to learn how to build AlertDialog and Custom dialog in android with kotlin language. you should have basic knowledge of kotlin, Activity, and Fragment.
A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog is normally used for modal events that require users to take an action before they can proceed. for example, to confirm a user logout we can use AlertDialog
, to pick a date we can use DatePickerDialog
, to pick a time we can use TimePickerDialog
**, **fordownloading information we can use ProgressDialog
or we can use custom dialog to contain more information by using DialogFragment
class.
There are two main classes for dialogs in android.
android.app.Dialog
and androidx.fragment.app.DialogFragment
. **Dialog **Class contains AlertDialog(Confirmation Dialog)
, DatePickerDialog
, TimePickerDialog
, ProgressDialog
and DialogFragment class contains custom dialog
.
Let’s see what is AlertDialog
#custom-dialog #dialogfragment #alertdialog #android-dialog