views:

507

answers:

2

Is there any way to use an image that I'm generating on the fly as a Notification icon?

A: 

Try creating a custom Notifications view, then you should be able to use a Bitmap object:

RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.custom_notification_layout);
contentView.setImageViewBitmap(R.id.icon_view, myBitmapObject);
notification.contentView = contentView;

For more info see "Creating a Custom Expanded View" on this page: http://developer.android.com/intl/de/guide/topics/ui/notifiers/notifications.html

mbaird
This is for the "expanded view", what you see when you open the notification drawer. This is not for the icon (`notification.icon`).
CommonsWare
Ah right, the icon that shows before you open the notifications. Sorry I wasn't thinking.
mbaird
+1  A: 

This topic was discussed in a previous SO question. Upshot: I don't think it is possible.

CommonsWare
Oh man, I saw that but decided it wasn't applicable (for some reason).
fiXedd