// variables to save user selected date and timepublic int yearSelected,monthSelected,daySelected,hourSelected,minuteSelected;// declare the variables to show the date and time whenTime and Date Picker Dialog first appearsprivate int mYear, mMonth, mDay,mHour,mMinute;

In the constructor you can initiallise the variable to current date and time.

In the example I have 2 buttons 1: Select Date - to show DatePickerDialog 2: Select Time - to show TimePickertDialogWhen user selects a Date and Time in respective Dialogs we will set the selected date and time in Respective buttons. We will set selected date in Select Date Button and selected time in Select Time Button(See the last Snapshot)main.xml