A
AC Question
notification dynamic large icon not working android (code below)
i want to show dynamic icon (generated by passing text) in notification area !
set small icon mathod uses already exists drawable package icon so i can't use that .
set large icon mathod uses bitmap image so i m generating bitmap image and passing it to setlargeicon mathod here is my code
Bitmap b1 = drawText(String.valueOf(level),24,24);
NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this)
.setLargeIcon(b1)
.setTicker("better level "+level);
Intent intent1 = new Intent( context1, MainActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(context1, 786 , intent1, 0);
builder.setContentIntent(pIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notif = builder.build();
notif.flags=Notification.FLAG_ONGOING_EVENT;
mNotificationManager.notify(786, notif);
i am not getting any notification .. if i use set small icon mathod with ic_launcher image it shows notification.
i want to show dynamic icon (generated by passing text) in notification area !
set small icon mathod uses already exists drawable package icon so i can't use that .
set large icon mathod uses bitmap image so i m generating bitmap image and passing it to setlargeicon mathod here is my code
Bitmap b1 = drawText(String.valueOf(level),24,24);
NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this)
.setLargeIcon(b1)
.setTicker("better level "+level);
Intent intent1 = new Intent( context1, MainActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(context1, 786 , intent1, 0);
builder.setContentIntent(pIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notif = builder.build();
notif.flags=Notification.FLAG_ONGOING_EVENT;
mNotificationManager.notify(786, notif);
i am not getting any notification .. if i use set small icon mathod with ic_launcher image it shows notification.