I would like to dynamically build-up a status bar icon from multiple
images.

Currently, the only way I can do this is using a ton of layer-list XML
files for all the combinations of the icons I would like to display.

I've seen code for doing something similar to the layer-list.xml files
in Java, but I can't figure-out how to "assign" my new layerlist or
layerdrawable to my icon's resource ID (required with the notification
API).

There was something very close to what I want to do over on
StackOverflow in "solution #2 (dynamic)" of this post:

http://stackoverflow.com/questions/2739971/overlay-two-images-in-android-to-set-an-imageview

Daniel's "solution #1" (in the above link) works wonderfully for the
static .xml files, but I'm looking for a more elegant, dynamic
solution.

In the above post, the code snippet:

  Resources r = getResources();
  Drawable[] layers = new Drawable[2];
  layers[0] = r.getDrawable(R.drawable.t);
  layers[1] = r.getDrawable(R.drawable.tt);
  LayerDrawable layerDrawable = new LayerDrawable(layers);

appears to be very close to what I want, but I don't know or
understand how to "assign" the new layerDrawable to my notification
icon (which takes an integer resource ID).

I have a sneaky suspicion that I simply cannot do this...but I thought
I'd ask here (its been over a month on StackOverflow with no replies).

Thanks!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to