Parts of my old app are deprecated, I am trying to rebuild it. Basically it is a Calendar with month view. This is a 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 the int day = date.getDate(); int month = date.getMonth(); int year = date.getYear();
are deprecated. I am trying to use the Calendar
class instead of Date
but unable to do the same. I know that for retrieve the day, month or year I can use this:
Calendar calendar = Calendar.getInstance();
calendar.get(Calendar.DAY_OF_MONTH);
but I don't know how to convert this line:
Date date = getItem(position);
for using with Calendar
.