Displaying TimePickerDialog using DialogFragment in Android with backward compatibilty support library

In this article we will create an Android application which demonstrate how to display a timepicker widget using dialog fragment. Since DialogFragment is introduced beginning with Android 3.0 ( API level 11 ) , we will make use Android support library to work this application in Android 1.6 ( API level 4 ) and its higher versions.

In this application, the set time is sent from TimePickerDialog to MainActivity using Handler object.