I am using LayerDrawable to build up a series of hotspots (indexes 1+) on an underlying image(index 0). The hotspots are added based on user interface interaction, and their position is dynamic, so I'm doing all of this programatically rather than using XML. As a further (probably irrelevant) detail, I am using a Fragment to hold the LayerDrawable, as this is in the contexts of an FragmentStatePagerAdapter and ViewPager.
The problem is that when I try to update an image by changing the Drawable in the LayerDrawable by called setDrawableByLayerId, the image does not change (despite the method returning true, indicating that it found the layer).
How can I get this to work?