0

(Unimportant background) I'm retrieving information of a notification and sending it to another Android Device where the Notification is exactly cloned and displayed.

Notification.Builder nb = new Builder(mContext); 
nb.set...;
nb.setSmallIcon(R.drawable.ic_launcher); 
Notification notification = nb.build();

This creates a notification with an Icon "R.drawable.ic_launcher" which is displayed in the Status bar and also in the android.R.id.icon ImageView of Notification contentview. I need to change both based on a bitmap. The image in contentview can be changed like this:

notification.contentView.setImageViewBitmap(RemoteViewsData.iconID, nd.contentView.icon); 

I need a way how to change the Icon in the statusbar.(i.imgur.com/2Yu56.png)

Ideas:

  1. Assign an ID at runtime. Is this possible?
  2. Don't change the ID but change the resource file (in storage) it is linked to. Where the resources are stored, are they writable.
4

0 回答 0