Dialog Registry

The DialogRegistry class is responsible for two things. It keeps a mapping between the dialog IDs and the actual dialog (factory) instances. It also translates the generic onCreate and onPrepare calls to the specific dialogs using the ID-to-object mapping. The ManagedDialogsActivity uses the DialogRegistry class as a repository to register new dialogs (see Listing 5-30).

Listing 5-30. The DialogRegistry Class public class DialogRegistry {

SparseArray<IDialogProtocol> idsToDialogs

= new SparseArray();

0 0

Post a comment