Android 我的闹钟服务don';t火

Android 我的闹钟服务don';t火,android,notifications,Android,Notifications,我到处都搜索过,但我能理解,因为我在一天中的某个特定时间的服务不会启动。什么也没发生。 设置警报的我的代码: AlarmManager alarmMgr = (AlarmManager) act.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(act, AlarmReceiver.class); PendingIntent alarmIntent = PendingIntent

我到处都搜索过,但我能理解,因为我在一天中的某个特定时间的服务不会启动。什么也没发生。 设置警报的我的代码:

AlarmManager alarmMgr = (AlarmManager) act.getSystemService(Context.ALARM_SERVICE);
        Intent intent = new Intent(act, AlarmReceiver.class);
        PendingIntent alarmIntent = PendingIntent.getBroadcast(act, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
        // set for 5 seconds later
        alarmMgr.set(AlarmManager.RTC_WAKEUP, Calendar.getInstance().getTimeInMillis()+5000, alarmIntent);
我的服务代码:

public class AlarmReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {

        System.out.println("Alarm worked well");
        Utils.criarNotificacao(context);
    }
}
在舱单中:

<receiver android:name="br.com.blacktoad.q48h2.utils.AlarmReceiver" android:process=":remote"></receiver>

我找不到任何答案。

我发现了错误! 我需要把这个:

<receiver android:name="br.com.blacktoad.q48h2.utils.AlarmReceiver" android:process=":remote"></receiver>


在清单中,但包含在“应用程序”标记中

看着你理想的
设置
它,但你不
设置重复
我猜!在API 18之前和之后,警报的工作方式也有所不同。看看。@Skynet你的意思是:
19岁之前和18岁之后。
是的,我的朋友:)不要工作,伙计们。我也用过这篇文章,但什么也没用。