Search code examples
javaandroidr.java-file

What's the difference between R and R.drawable?


R and R.drawable are two different classes within the Android framework, both of which inherit from Object. They seem very similar to me; what's different about them?


Solution

  • Android.R is a set of built in constants provided by the android SDK. The R class represents the resources in the Android.R xml file.

    The R.drawable class contains resources which can be drawn on to the screen. E.g. Bitmaps, NinePatchDrawble etc...