By R.drawable you are referring to the drawable property of R. This property is of type Drawable, which is an interface. You cannot instantiate an interface, only one of the implementing subclasses. These classes can be found in the Drawable API: http://code.google.com/android/reference/android/graphics/drawable/Drawable.html
BitmapDrawable, ClipDrawable, ColorDrawable, DrawableContainer, GradientDrawable, InsetDrawable, LayerDrawable, NinePatchDrawable, PictureDrawable, RotateDrawable, ScaleDrawable, ShapeDrawable So you will do something like this: Drawable d = new BitmapDrawable(); I suggest you should read one of the many Java books out there to get acquainted with the language basics, before delving into a particular framework/mobile OS like Android. Regards On Dec 30, 5:44 pm, myIP <[email protected]> wrote: > As being new to Java; I am having a problem declaring a variable of > R.drawable type. How can I this be done? Below are my failed > attempts: > > R d = R.drawable; > R.drawable d = R.drawable; > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

