'How can I get currenly selected date of CaledarView?

I am creating application with Calendar View and i want to store data of currently selected date in variable. To do that I used OnDateChangeListener. Everything is working but if I don't select any other date when opening activity and leave Calendar on default date (of course it highlights a date on which I am opening the app), variable is storing nothing and OnDateChangeListener is not working. In short I have to click on any date on calendar to save it in variable. Date which is highlighted by default is not getting stored in variable. Sorry for my bad English.



Solution 1:[1]

I created simple DateFormate and converted it into string. Then created 3 strings like year, month and date and then I assigned those 3 strings as substring of simple DateFormat.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jayur Pithava