On back press in date picker and time picker dialog there is known issue in android jellybean and higher that onDateSet() and onTimeSet() methods are called. To overcome this issue i have found a solution for date picker here(https://stackoverflow.com/a/11493752) but the java file(mentioned in 1st point) provided in it has getDatePicker() method for getting date picker from date picker dialog. But there is no such getTimePicker() method for getting time picker. Can anyone help me with this so that time picker also behaves similar to date picker.
Thanks in advance.
I did a lot of digging and have found a solution to this and it works fine in my project. In time picker we don't need to get time picker from time picker dialog as it does for date picker by getDatePicker() method. Just create a new Time picker and pass that only to listener in onTimeSet().