EDITED: I believe this question is NOT a duplicate of other questions since it applies specifically to CodenameOne , and how it uses the android libraries, not just to the android libraries themselves. I believe that either a) I need help in how to use the CodenameOne classes correctly, or b) the CodenameOne classes needs to be updated to work with Android 5.1.1.
The problem: When I use 'scheduleLocalNotification' with CodenameOne compiled to Android, the notification works but the message contains only white squares where I would expect the application icon. My test code is very like that in the documentation for Class LocalNotification
in codenameone:
LocalNotification n = new LocalNotification();
n.setId("LnMessage");
n.setAlertTitle("Alert Title");
n.setAlertBody("Alert detailed message");
Display.getInstance().scheduleLocalNotification(
n, System.currentTimeMillis()+10, LocalNotification.REPEAT_NONE
);
Full example: https://gist.github.com/twilkinson/893d96bcf84698e0c694775b99174460
Here are a couple of screen shots from the Android device that illustrate my problem.
Image 1
Image 2
I've tried placing an image file alert-image.png
in the project beside theme.res
and adding the line
n.setAlertImage("alert-image.png");
but that doesn't seem to help.
My device is a Nexus 4 with Android version 5.1.1
Can someone point me to an example somewhere of how to make this work?
UPDATED: At Shai's suggestion (below), I added an image file ic_stat_notify.png to the native/android folder (white on transparency). The result was no change to the notification area image ("Image 1" above), but the new image showed in the expanded notification drawer ("Image 3" below).
Image 3