我已经查找了有关如何使 android 设备 LED 闪烁的示例,并且收到了有关无法将 LED_NOTIFICATION_ID 解析为变量的消息。我的代码如下。有没有人可以告诉我为什么我会收到这个错误?
private void redFlashLight(Context context)
{
NotificationManager nm = ( NotificationManager ) context.getSystemService( context.NOTIFICATION_SERVICE );
Notification notif = new Notification();
notif.ledARGB = 0xFFff0000;
notif.flags = Notification.FLAG_SHOW_LIGHTS;
notif.ledOnMS = 100;
notif.ledOffMS = 100;
notif.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_ONLY_ALERT_ONCE;
nm.notify(LED_NOTIFICATION_ID, notif);
}