タイムピッカーから時間がかかり、仕事をするためにスケジュール時間を設定すると、問題が発生します
SharedPreferences prefs = getSharedPreferences("CONSTANT_FILE_NAME",Context.MODE_WORLD_WRITEABLE);
SharedPreferences.Editor editor= prefs.edit();
editor.putLong("timepickerhour", timePicker.getCurrentHour());
editor.putLong("timepickerminute", timePicker.getCurrentMinute());
editor.putLong("milis", milis);
editor.commit();
SharedPreferences prfs = getSharedPreferences("CONSTANT_FILE_NAME",Context.MODE_PRIVATE);
h =prfs.getLong("timepickerhour",0);
m =prfs.getLong("timepickerminute",0);
r =prfs.getLong("milis",0);
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent intent1 = new Intent(Scheduling.this, Feedback.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(Scheduling.this, 0,
intent1, PendingIntent.FLAG_UPDATE_CURRENT);
Calendar calendar1 = Calendar.getInstance();
calendar1.set(Calendar.HOUR_OF_DAY, (int) h);
calendar1.set(Calendar.MINUTE, (int) m);
am.setInexactRepeating(AlarmManager.RTC_WAKEUP,calendar1.getTimeInMillis(),
r, pendingIntent);
過去の時間を与えると問題に直面し、今は午後 2 時 25 分に設定した場合、現在の時間は午後 4 時 25 分であり、そのスケジューリング タスクはその場で実行されます。午後 38 時、時刻を午前 4 時 38 分に設定し、コードも実行します。
助けてください
よろしくお願いします