user2867831
user2867831

Reputation: 15

Android Calendar get year

I'm trying to display in the DatePickerDialog the next year, but I get 1900. What is the problem with this code?

.get(Calendar.YEAR + 1),

Upvotes: 0

Views: 3238

Answers (2)

Agilarasan anbu
Agilarasan anbu

Reputation: 2805

If you need a datepicker with only year (Year Calendar) , then please refer YearPicker
for more information. its an customized yearPicker

enter image description here

Upvotes: 0

Dodd10x
Dodd10x

Reputation: 3349

Try this:

.get(Calendar.YEAR) + 1,

Upvotes: 8

Related Questions