I was reading about Android, and it was an method ShowAlert, but a friend tell me that ShowAlert was updated to ShowDialog but i dont know how to use it.
Can anyone tell me how can i use it???
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In android you can create following types of dialog :
AlertDialog
ProgressDialog
DatePickerDialog
TimePickerDialog
Apart from these you can also create your own custom dialog.
For alter Dialog you have to use class AlertDialog.
First you set properties of alert dialog by creating builder of dialog as:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
Now you can set some of properties of this builder by using some functions like setMessage(), setCancelable(),setPositiveButton(),setNegativeButton() etc.
Last step is to create your dialog. For this:
AlertDialog alert builder.create();
and then you can use alert.show() to display your alert.