enter image description here

I cannot call any method of the LocalDate class, since this requires a minimum API of 26.

I have:

enter image description here

How then to work for API below 26?

  • maybe it will work - Time time = new Time (Time.getCurrentTimezone ()); time.setToNow (); String date = time.format ("% Y:% m:% d"); - Ruslan

1 answer 1

The LocalDate class appeared relatively recently. In Java, starting with version 1.8, and in Android with API 26. If you need this particular class, you will have to limit yourself to API26, or use other solutions (what exactly you need to get in the question you did not specify), which the minimum required API supports After all, for many years they somehow managed without this class.