The getBackgound()
returns BitmapDrawable
Log.d(null,"drawable: " + v.getBackground());
How to get the drawable as R.drawable.xxx?
view.getBackgroundDrawable();
Use this to get the background drawable . This will return drawable
Edit
this working in versions below jelly bean , when this answer was written now this method is deprecated in latest versions
New Edit
For versions after jellybean try
view.getBackground()
If someone wants to compare the drawables follow this answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With