get Tomorrow At hour and minute - Android java.util

Android examples for java.util:Calendar

Description

get Tomorrow At hour and minute

Demo Code

import android.util.Log;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main{

    public static Calendar getTomorrowAt(int hours, int minutes) {
        Calendar today = Calendar.getInstance();
        Calendar cal = Calendar.getInstance();
        cal.clear();/*from  w w w .  ja v a  2 s .  co  m*/

        int year = today.get(Calendar.YEAR);
        int month = today.get(Calendar.MONTH);
        //represents the day of the month
        today.add(Calendar.DATE, 1);
        int day = today.get(Calendar.DATE);
        cal.set(year, month, day, hours, minutes, 0);
        return cal;
    }

}

Related Tutorials