The past few days I\'ve been searching for ways to get a \'readable\' date out of my calendarview from android 4.0. I can\'t manage to find a solution or example that suits
kandroidj's answer helps to create date, but not date of correct format. So to format selected date:
calendarView.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
@Override
public void onSelectedDayChange(CalendarView view, int year, int month,
int dayOfMonth) {
final SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
Calendar calendar = Calendar.getInstance();
calendar.set(year, month, dayOfMonth);
String sDate = sdf.format(calendar.getTime());
Log.d(TAG, "sDate formatted: " + sDate);
}
});