import android.app.Activity; import android.graphics.drawable.Drawable …. First, if you want to do it like this then your Activity needs to implement View.