试图根据用户使用 phonegap android 使用 Cordova 2.2.0 设置的日期和时间发出警报或提醒已从此处下载 phonegap localnotification 插件: phonegap android localnotification plugin 我刚刚达到其初始阶段并在这行文件中出现错误命名为:ALARMRECEIVER.JAVA:
// Construct the notification and notificationManager objects
final NotificationManager notificationMgr = (NotificationManager) systemService;
final Notification notification = new Notification(R.drawable.ic_launcher, tickerText,
System.currentTimeMillis());
final PendingIntent contentIntent = PendingIntent.getActivity(context, 0, new Intent(), 0);
notification.defaults |= Notification.DEFAULT_SOUND;
notification.vibrate = new long[] { 0, 100, 200, 300 };
notification.setLatestEventInfo(context, notificationTitle, notificationSubText, contentIntent);
/*
* If you want all reminders to stay in the notification bar, you should
* generate a random ID. If you want do replace an existing
* notification, make sure the ID below matches the ID that you store in
* the alarm intent.
*/
notificationMgr.notify(notificationId, notification);
错误仅在此行:
final Notification notification = new Notification(R.drawable.ic_launcher, tickerText,
System.currentTimeMillis());
红色突出显示我:
R cannot be resolved to a variable
仅仅因为一个错误无法运行这个项目