Showing the DatePickerFragment
Now that the DialogFragment has been implemented, this section will examine how to use the fragment in an Activity. In the sample app that accompanies this guide, the Activity will instantiate the DialogFragment using the NewInstance factory method and then display it invoke DialogFragment.Show. As a part of instantiating the DialogFragment, the Activity passes an Action, which will display the date in a TextView that is hosted by the Activity: