setBackground vs setBackgroundDrawable (Android)

I want to set background drawable of a view. There are two methods for this (as far as I see): setBackground and setBackgroundDrawable.

When I use setBackground, it says it has been added in API level 16 but my project’s min SDK version is 7. I assume it’s not going to work on anything below 16, am I right? But when I use setBackgroundDrawable, it says it’s deprecated.

What am I supposed to use?

12 Answers
12

Leave a Comment