trying make alarm or reminder per date , time set user using phonegap android using cordova 2.2.0 have download phonegap localnotification plugin here: phonegap android localnotification plugin reached towards initial stage , getting errors on line of file named as: alarmreceiver.java:
// construct notification , 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 want reminders stay in notification bar, should * generate random id. if want replace existing * notification, make sure id below matches id store in * alarm intent. */ notificationmgr.notify(notificationid, notification);
error on line only:
final notification notification = new notification(r.drawable.ic_launcher, tickertext, system.currenttimemillis());
red higlighted showing me:
r cannot resolved variable
just because of single error unable run project
from plugin readme:
fix import in alarmreceiver.java around line 67 r.drawable.ic_launcher referenced matches icon in project
make sure have icon named ic_launcher in /res/ folder. check don't have xml errors in of files in /res/ folder. r class automatically generated /res/ folder , if missing, or if there bad xml, etc., not created, causing error. if still getting error try doing make-->clean. there other questions on stackoverflow missing r file or r not being generated.
Comments
Post a Comment