完善开始闹钟开始导入不能使用直接注释掉
package timeline.lizimumu.com.t.util;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
public class AlarmUtil {
public static void setAlarm(Context context) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (alarmManager != null) {
long start = System.currentTimeMillis();
Intent in = new Intent(“ALARM_RECEIVER”);
PendingIntent pi = PendingIntent.getBroadcast(context, 0, in, PendingIntent.FLAG_CANCEL_CURRENT);
alarmManager.set(AlarmManager.RTC_WAKEUP, start + 86400 * 1000, pi);
}
}
}
原创文章,作者:1402239773,如若转载,请注明出处:https://blog.ytso.com/273156.html