![Windows 10にしたら夜中のスリープ復帰が増えた!【Windows 10移行相談室】](https://cdn-ak-scissors.b.st-hatena.com/image/square/d2dd4e7888e44a6933f3b2d70e74a2014027b6c6/height=288;version=1;width=512/http%3A%2F%2Fforest.watch.impress.co.jp%2Fimg%2Fwf%2Flist%2F1007%2F373%2F7-01.png)
結論から言うと、AlarmManagerとPowerManager.WakeLockを組み合わせて使えばよい。 具体的には、まず、AlarmManagerを使用して、定期的にBroadcastのIntentを投げる。AlarmManager.RTC_WAKEUPを指定して、端末がスリープ中でもBroadcastが行われるようにしておく。 public class Foo { private static final long INTERVAL = AlarmManager.INTERVAL_FIFTEEN_MINUTES; public void setBroadcast() { Intent intent = new Intent(this, BarReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadc
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く