It's part of the code cleanup, to make the XML attributes conform to the
Java setter/getter properties and vice versa.
Eg.
Setting a background in XML is done through the *android:background*attribute.
The corresponding setter of the attribute in Java was *setBackgroundDrawable
*.
The two attribute names are not the same: *drawable *vs *backgroundDrawable*
.
They decided to make them the same by changing the Java name of this
attribute to *drawable *as well, resulting in a setter called *setDrawable*.
On Thursday, October 25, 2012 11:06:45 AM UTC-4, kj wrote:
> Hi all,
> I was looking over the View class source today and noticed that
> setBackgroundDrawable() has been deprecated as of API 16 in favor of
> setBackground(). I'm curious as to why this is, as the current
> View.setBackground() method just calls setBackgroundDrawable(). What was
> the reason for the change and should I being to switch my calls to
> setBackgroundDrawable() to setBackground()?
> Thanks,
> KJ