2014-09-29 86 views

回答

0

您需要android.permission.SET_TIME。 使用AlarmManager通過Context.getSystemService(Context.ALARM_SERVICE)方法setTime()

段:

Calendar cal = Calendar.getInstance(); 
cal.set(2014, 9, 29, 18, 19, 00); 

AlarmManager am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE); 
am.setTime(cal.getTimeInMillis()); 
相關問題