每十分钟本地通知一次

Local notification every ten minutes

我写了:

LocalNotification localNotification = new LocalNotification();
        localNotification.setId("Gratitudine");
        localNotification.setAlertTitle("Pratica della Gratitudine");
        localNotification.setAlertBody("Leggi e ripeti interiormente");
        localNotification.setAlertSound("/notification_sound_bell.mp3");
        // alert sound file name must begin with notification_sound

        Display.getInstance().scheduleLocalNotification(localNotification,
                System.currentTimeMillis() + 60 * 1000, // first notification
                LocalNotification.REPEAT_MINUTE // Whether to repeat and what frequency
        );

有效。

每十分钟重复一次通知的正确方法是什么?唯一可用的选项是:REPEAT_NONEREPEAT_MINUTEREPEAT_HOURREPEAT_DAYREPEAT_WEEK

任意分钟数(例如 4 或 13 分钟)的相同问题。

谢谢

根据 documentation 这似乎是不可能的。你只能让它每分钟重复一次。为了做你想做的事,你可能需要每隔一段时间设置额外的通知。这意味着如果你想取消它们,你将需要在用户点击通知并打开应用程序时或在其他事件中这样做。