Last Updated: February 25, 2016
·
383
· spectralnischay

AlertDialogs

When making AlertDialogs, we generally use a fragment that extends DialogFragments. These DialogFragments always go through a lifecycle process which trigger a onCreateDialog. Hence when combining creating dialogs with ContentLoaderListeners, we need to make sure the onCreateDialog is explicitly doing some work in our code. (Otherwise we will be left with a really bad UI of blank dialogs behind or on top of our loaded content).

We hence need to load the view that our content is being loaded in, inside the onCreateDialog process, and then use ContentLoaders to populate that. Something to keep in mind when working with the easy but subtly tricky world of Android Dialogs.