Is it every a good idea to build an
AlertDialog on a background thread? Some dialogs can contain a lot of information, like long lists, which can take a while to load. Is it worth moving to a background thread to build?
You could gather the data in a background thread, but the dialog must be created in the main thread. In general, assume everything in the entire Android framework is meant to be called in the main thread, unless documented otherwise.
It's a good idea to do all expensive works outside the main thread in order to keep the UI reactive. When gathering displayed information can be time expensive then you should use a background thread.
After you've gathered all information then you definitely need to show the
AlertDialog from within the main thread. No other hread then the main thread should do anything UI related.