I want to create a drawable, which consists of a map pin(bubble) and some text. The bubble should be in the background and the text in the foreground.
This drawable should be passed in super(drawable) of the class BalloonItemizedOverlay which extends ItemizedOverlay<Item>.
In other words, I want to show text in the bubble that appears in the map.
I am using the Hello Mapview tutorial
This method takes a drawable from your resources, draws some text on top of it and returns the new drawable. All you need to do is give it the resource id of your bubble, and the text you want on top. Then you can pass the returned drawable wherever you want it.
To preserve density you need this constructor
So, keeping your context, last return should be something like
This prevent an undesired resized drawable.