1

I have a piece of code that extends ColorDrawable and calls the super with Color.Black. Is there an alternative where i can use a drawable from my drawables directory ?

//Want to Have a drawable/res instead of just a plain Color type ? 
static class DownloadedDrawable extends ColorDrawable {

    public DownloadedDrawable(Color color) {
        super(color);

    }

    // Other code,
}

Kind Regards,

AndroidDev
  • 15,993
  • 29
  • 85
  • 119
  • If you want a `Drawable` that's *not* a `ColorDrawable` then you shouldn't subclass from `ColorDrawable` in the first place. Maybe you can explain your broader scenario. – kabuko Oct 02 '12 at 17:45
  • http://code.google.com/p/android-imagedownloader/source/checkout. I use this Library in my code. This sets a Drawable to a ImageView and wraps a AsyncTask in it. I want my own drwable instead of the simple black color while a ImageView is been processed. – AndroidDev Oct 02 '12 at 18:51

1 Answers1

0

That's not really a library; it's just an example project but if you want to have an image instead of just black, try deriving from BitmapDrawable instead of from ColorDrawable. You can pass in the desired Bitmap.

kabuko
  • 36,028
  • 10
  • 80
  • 93