Which is the meaning of the second parameter of Drawable.createFromStream() method?
From Android APIs I only get:
public static Drawable createFromStream (InputStream is, String srcName)
Create a drawable from an inputstream
In all examples I have read I see they use the string "src": is it the name of the directory where the drawable is cached, relative to my application's root dir?
One parallel question: where am I supposed to find Android core sources (for example of Drawable.createFromStream() method…), to avoid such silly questions, in future?
Best Solution
It's basically useless:
Based on Froyo source, it is used when creating nine-patch images from the resource, but not when creating a regular Bitmap:
You get there by following the Drawable code:
createFromStream
returns:which in turn uses:
(np comes from
Bitmap#getNinePatchChunk();
) and this calls:Finally, you get to the NinePatch declaration: