I need to create a Calendar with a specific date and time.
private void setNotification(String date, String time) {
Log.i("log", "1");
//Get date & time
String[] dateArr = date.split(".");
String[] timeArr = date.split(":");
Log.i("log", "2");
//Set calender to lesson's date & time
Calendar cal = Calendar.getInstance();
cal.set(Integer.valueOf(dateArr[2]), Integer.valueOf(dateArr[1]) - 1, Integer.valueOf(dateArr[0]), Integer.valueOf(timeArr[0]), Integer.valueOf(timeArr[1]));
Log.i("log", "3");
//Schedule notification
scheduleNotification(CreateNewLesson.this, cal.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), Integer.valueOf(dateArr[0] + dateArr[1] + dateArr[2] + timeArr[0] + timeArr[1]));
}
The date String format is DD.MM.YYYY and the time is HH:MM, when I call the function I can see the "2" log but not the "3".
why is that?