Android Calendar Illegalargumentexception When Calendar.month Set To 1
The code below works fine except when calendar.MONTH set to 1 (Feb),and I do not know why ? Thanks. Calendar calendar = Calendar.getInstance(); calendar.setLenient(false);
Solution 1:
You're getting the current date in getInstance. Then you're setting the month to February. The problem is that today is the 30th. February has 28 days. That's an illegal combo. Change the day to a valid day, then change the month.
Post a Comment for "Android Calendar Illegalargumentexception When Calendar.month Set To 1"