We know how simple is to create Date Picker Dialog and Time Picker Dialog ! but so what about a situation where we need to pick Time and Date both at once with all attributes e.g AM_PM, second, minute, Hour, Month, Year etc. We got stuck right?
I have search a lot about this on Google but i did not find efficient and easy solution. So decide to write about this important concept. While you are developing any android application then you just copy one class from my sample project. and your work has done.
There are two simple step to understand what's going on in my project
1) Create object of CustomDateTimePicker with two argument Your Current activity context and one Call back listener so that when you select time and date, it will return result
2) CustomDateTimePicker has number of method to fulfill your custom requirement like---
/**
* Pass Directly current time format it will return AM and PM if you set
* false
*/
custom.set24HourFormat(false);
/**
* Pass Directly current data and time to show when it pop up
*/
custom.setDate(Calendar.getInstance());
Custom is instance of my CustomDateTimePicker .Except this , CustomDateTimePicker has number of method.
The Output of my sample project will be like these screen shot.
I have search a lot about this on Google but i did not find efficient and easy solution. So decide to write about this important concept. While you are developing any android application then you just copy one class from my sample project. and your work has done.
There are two simple step to understand what's going on in my project
1) Create object of CustomDateTimePicker with two argument Your Current activity context and one Call back listener so that when you select time and date, it will return result
2) CustomDateTimePicker has number of method to fulfill your custom requirement like---
/**
* Pass Directly current time format it will return AM and PM if you set
* false
*/
custom.set24HourFormat(false);
/**
* Pass Directly current data and time to show when it pop up
*/
custom.setDate(Calendar.getInstance());
Custom is instance of my CustomDateTimePicker .Except this , CustomDateTimePicker has number of method.
The Output of my sample project will be like these screen shot.
Date And Time Picker |
Selected Value |
I wonderment why other professionals don't respond your website overmuch m happy I plant this.
ReplyDeleteone click root
Thank you ..I think every process take time. I am new blogger just start blogging few month ago.Everything will fall in place when time will come. Any way thank you for your support
DeleteThis is awesome work Tofeeq. You really are not getting the kind of applause you deserve especially since this is so much better than what I have seen being shown around. Great work!!
ReplyDeleteThank you Daniel..This is my big achievement that i have a reader like you. Keep visiting this blog
DeleteHi tofeeq, this is exactly what I was looking for my application (assuming Calendar grid widget is not common yet) I have tested it it within the application and it works great. cool work! Can I have your permission to use it?
ReplyDeleteThank you..and i am glad that you like it. Feel free to use all my stuff present on this blog
Delete