Simplifying the Managed Dialog Protocol

As you've probably noticed, working with managed alert dialogs can become quite messy and can pollute the mainline code. If we abstract out this protocol into a simpler protocol, the new protocol could look like this:

1. Create an instance of a dialog you want by using new and keeping it as a local variable. Call this dialogl.

2. Show the dialog using

3. Implement one method in the activity called dialogFinished().

4. In the dialogFinished() method, read attributes from dialogl such as dialogl. getValue1().

Under this scheme, showing a managed alert dialog will look like this:

0 0

Post a comment