Does an AlertDialog.show() start a new thread? I don’t see any indication in the Android documentation that it does, and would like confirmation.
Specifically, I want to make sure that the OnDismiss() callback occurs on the UI thread.
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.
Short: No, it doesn’t create a new thread and yes it runs in the ui thread.
Long: It should be running in the ui thread since it modifies ui stuff but you can create it from another thread and you will end having an exception. If you have a second thread you should do all the
AlertDialogcalls from the ui thread using one of the different ways to communicating with the ui thread. For instancerunOnUiThread