Back to project page SoundScheduler.
The source code is released under:
GNU General Public License
If you think the Android project SoundScheduler listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Sound Scheduler//from w w w .ja v a2 s .com * Copyright (C) 2013 Victor Kifer */ package com.victorkifer.SoundScheduler.receivers; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.*; import android.os.SystemClock; import android.util.Log; public class BootCompleteReceiver extends BroadcastReceiver { private static final String TAG = BootCompleteReceiver.class.getSimpleName(); private static final int MINUTE = 60*1000; @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "Registering receiver"); createAlarmBasedReceiver(context); } public static void createAlarmBasedReceiver(Context context) { AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); PendingIntent pi = PendingIntent.getBroadcast(context.getApplicationContext(), 0, new Intent(TimeChangeReceiver.ACTION_ALARM_CALL), 0); alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, (SystemClock.elapsedRealtime() / MINUTE)*MINUTE + MINUTE, MINUTE, pi); } }