0

I want to let users could select an external images in sdcard as notification icon. However, it seems to be impossible, and only an internal image with resource id could be used as notification icon.

Therefore, I may need a method to set a bitmap as notification icon.

Sample for notification, and only the resource id could be set as notification icon not a bitmap.

int icon = R.drawable.notification_icon;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);

Also, I know that a Custom Expanded View for notification is possible to use external image, but still it's not for notification icon.

Appreciated.

dong221
  • 3,390
  • 6
  • 29
  • 31

2 Answers2

0

I just review my favorite questions and it seems that this particular problem has been resolved in 4.+ Here is a solution: Android - use external profile image in notification bar like Facebook

Community
  • 1
  • 1
piotrpo
  • 12,398
  • 7
  • 42
  • 58
0

You can give your image id in icon's reference id to show as an image. I personally did it in both Custom and Non customer notification

Sarmad
  • 389
  • 2
  • 8
  • Thanks, could you give more description about how to give a resource id to an external image in sdcard? – dong221 Jun 27 '11 at 06:50
  • hmm...i cant give the code right now but can give an idea that you can generate UUID against a Bitmap and then can reference it as an int – Sarmad Jun 27 '11 at 07:09
  • Could you please provide some hints? BTW, could I download your application from market for testing? Thanks. – dong221 Jun 27 '11 at 12:20