Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:19:42+00:00 2026-05-22T18:19:42+00:00

Which is the meaning of the second parameter of Drawable.createFromStream() method? From Android APIs

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:19:43+00:00Added an answer on May 22, 2026 at 6:19 pm

    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:

    852 private static Drawable drawableFromBitmap(Resources res, Bitmap bm, byte[] np,
    853         Rect pad, String srcName) {
    854
    855     if (np != null) {
    856        return new NinePatchDrawable(res, bm, np, pad, srcName);
    857     }
    858
    859     return new BitmapDrawable(res, bm);
    860  }
    

    You get there by following the Drawable code:

    createFromStream returns:

    return createFromResourceStream(null, null, is, srcName, null);
    

    which in turn uses:

    return drawableFromBitmap(res, bm, np, pad, srcName);
    

    (np comes from Bitmap#getNinePatchChunk();) and this calls:

    return new NinePatchDrawable(res, bm, np, pad, srcName);
    

    Finally, you get to the NinePatch declaration:

    public class NinePatch
    

    Create a drawable projection from a
    bitmap to nine patches.

    Parameters:

    bitmap The bitmap describing the patches.

    chunk The 9-patch data chunk describing how the underlying bitmap
    is split apart and drawn.

    srcName The name of the source for the bitmap. Might be null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a function that reads data (data meaning exclusively strings) from disk, which should
Which class design is better and why? public class User { public String UserName;
Which of the following has the best performance? I have seen method two implemented
Reading from MSDN: A delegate is a type that references a method. Once a
I am working on a game engine which is loosely descended from Quake 2,
Which graduate program should I choose – SUNY Buffalo or SUNY Binghamton?
Which Database table Schema is more efficient and why? Users (UserID, UserName, CompamyId) Companies
Which C#/.NET Dependency Injection frameworks are worth looking into? And what can you say
Which way do you prefer to create your forms in MVC? <% Html.Form() {
Which is better? Or use and OR mapper with SP's? If you have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.