AlarmManager不是Android的棒棒堂准时火灾

AlarmManager不是Android的棒棒堂准时火灾

本文介绍了AlarmManager不是Android的棒棒堂准时火灾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这个code设置闹钟在Android的奇巧和棒棒糖:

i'm using this code to set Alarm in Android KitKat and lollipop:

    AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
    Intent i = new Intent(AlarmService.this, Reciver.class);
    PendingIntent pi = PendingIntent.getBroadcast(AlarmService.this, 1201, i, PendingIntent.FLAG_UPDATE_CURRENT);
    Calendar c = Calendar.getInstance();
    c.set(Calendar.HOUR_OF_DAY, 9);
    c.set(Calendar.MINUTE, 0);
    c.set(Calendar.SECOND, 0);
    am.setExact(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(), pi);

这code是Android KitKat上,但在Android棒棒糖其火灾的好作品与延迟10分钟或5分钟。

this code is works good on Android KitKat but on Android Lollipop its fires With 10 or 5 minutes delayed.

推荐答案

这是在Android中棒棒糖一个已知的bug,并已通过在Android的官方bug跟踪其他一些用户报告。有没有立即解决这个问题,但你可以在这里获得关于此问题的更新:的

This is a known bug in Android Lollipop and has been reported by several other users on Android's official bug tracker. There's no immediate solution to this problem, but you can get updates regarding this issue here: https://code.google.com/p/android/issues/detail?id=82001

这篇关于AlarmManager不是Android的棒棒堂准时火灾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 18:57