So, i found the java.util.Calendar, and tried to use it for a android project i'm working on.
I do not understand at all how Calendar.DAY_OF_WEEK can return 7, when it's Thursday? And now when it's August Calendar.WEEK_OF_YEAR returns 4, which doesn't make any sense at all!
I have tried GregorianCalendar too, and it gives exactly the same results.
Tried to find any documentation about how they count, but i can't find anything. Seems like there is something very obvious, but which i just cannot find out what it is!
The code i wrote is here:
// Get if daily or weekly
boolean daily;
daily = getPrefs.getBoolean("checkbox_daily", false);
String day = "0";
if (daily){
switch(GregorianCalendar.DAY_OF_WEEK){
case GregorianCalendar.MONDAY:
Do_stuff();
break;
case GregorianCalendar.TUESDAY:
Do_stuff();
break;
case GregorianCalendar.WEDNESDAY:
Do_stuff();
break;
case GregorianCalendar.THURSDAY:
Do_stuff();
break;
case GregorianCalendar.FRIDAY:
Do_stuff();
break;
}
}