Answer the question
In order to leave comments, you need to log in
Change Calendar date in android?
Good!
Is it possible to add or subtract N days in Calendar and have it give out what the number will be, of course, taking into account the month and high year? Or do you need to write everything in the old fashioned way with pens?
Now I get the date for today
TextView forDate = new TextView();
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String strDate = sdf.format(calendar.getTime());
forDate.setText(forDate.getText() + " " + strDate);
Answer the question
In order to leave comments, you need to log in
calendar.add(Calendar.DAY_OF_YEAR, 10);
forDate.setText(calendar.getTime());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question