I'm trying to get start and end dates of current week, start day must be the SUNDAY and end Day must be the SATURDAY, I have written the following code ---
Calendar cal1 = Calendar.getInstance();
// Set start Day as SUNDAY
cal1.setFirstDayOfWeek(Calendar.SUNDAY);
cal1.set(Calendar.DAY_OF_WEEK, cal1.getFirstDayOfWeek());
Date fromDate=cal1.getTime();
String strFromDate = df.format(fromDate);
cal1.add(Calendar.DAY_OF_YEAR, 6);
Date toDate=cal1.getTime();
String strToDate = df.format(toDate);
Above code working excellent on emulator and other devices except "SAMSUNG device". In Samsung device, it gives start and end dates of next week for the same code. Please help.. Thanks..!!