Parts of my old application are out of date, I'm trying to rebuild it. This is mainly a calendar with monthly viewing. This is part of my gridview adapter:
public View getView(int position, View view, ViewGroup parent) { Date date = getItem(position); int day = date.getDate(); int month = date.getMonth(); int year = date.getYear(); }
and int day = date.getDate(); int month = date.getMonth(); int year = date.getYear(); int day = date.getDate(); int month = date.getMonth(); int year = date.getYear(); outdated. I am trying to use the Calendar class instead of Date , but I cannot do the same. I know that to extract the day, month or year I can use this:
Calendar calendar = Calendar.getInstance(); calendar.get(Calendar.DAY_OF_MONTH);
but I do not know how to convert this string:
Date date = getItem(position);
for use with Calendar .
java android android-gridview calendarview
Dan NoNeed
source share