Android examples for java.util:Day
get Next Sunday
import android.annotation.SuppressLint; import android.util.Log; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main{ public static CustomDate getNextSunday() { Calendar c = Calendar.getInstance(); c.add(Calendar.DATE, 7 - getWeekDay() + 1); CustomDate date = new CustomDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH) + 1, c.get(Calendar.DAY_OF_MONTH)); return date; }// ww w. j av a 2 s .com }