Create a Drawable Object Variable

This will declare and name an Drawable object variable

Drawable was added in API Level 1
A Drawable is a general abstraction for "something that can be drawn." Most often you will deal with Drawable as the type of resource retrieved for drawing things to the screen; the Drawable class provides a generic API for dealing with an underlying visual resource that may take a variety of forms. Unlike a View, a Drawable does not have any facility to receive events or otherwise interact with the user.

1. Create an Android project, if you don't already have one.

2.In the MainActivity.java file, add the code below to the onCreate method. This will create a Drawable  named myDrawable

    Drawable myDrawable;

3. Compile and run!

Next Recommended Article: Set a Drawable

Resources: