can anyone help me out in displaying a calender.
I tried out using date and time picker.
But i need a way to make the user click a button and on the click of it a calender gets displayed.
Any help would be appreciatable.
Thanks in advance.

Recommended Answers

All 8 Replies

Have button or image button click event invoke DatePickerDialog or extend DialogFragment if using fragments and build own date picker (plenty of examples on the web)

thanks for the reply peter budo.
i want a calender to be implemented not using the datepicker.
i want the calender as in the link. Click Here
thanks in advance

You will have to create your own custom component/dialog, hence above is not used in any android forms. The only implementation is Calendar application, but that is application not a single component to just add to form and select date. If you insist on something like that consider use table or grid layout

so we have to create a seperate project that displays the calender as i want it to do and use that project in any of the other projects in which i want that calender to be displayed?

Yes and no. You may use some of the already available projects that been turned to libraries that can be included in the project or do your own coding like did this guy

i saw that in android 4.0 we are having an inbuild calender.
But can we use the same (in any way) for any lower versions

I wasn't aware of CalendarView that is available since version 3.0. From what I read this is not available to lower version as it is not part of so called Support Package unlike fragments and other stuff.

As for previous question, yes you can bring it to your project, just copy Java source files and include resources from original projects and then call them in your project as you need

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.