Is there any difference between .create() and .show() methods of AlertDialog’s builder class? Like when we create an alert dialog using:
AlertDialog.Builder builder = new
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage("");
builder.setPositiveButton(....)
builder.setNegativeButton(....)
What is recommended pratice to use and why?
builder.create() //I have seen this creates and displays the dialog
OR
builder.show() //this also displays the dialog
OR
builder.create().show() //well same thing
I have read the documentation. But was unable to make any sense from it. Any ideas ?
obj.create()-For create Dialogobj.show()-For show Dialog<- without it you cant show dialog if you created.and
obj.create().show()-create and show Dialog i mean both same as above two in one statement.