I want to put an image as background of a Layout.
First I am creating a drawable : Drawable d = Drawable.createFromPath("pathToImageFile");
In API level 8 layout.setBackground( d )
is not supported AND layout.setBackgroundDrawable( d )
is deprecated so I need to use
layout.setBackgroundResource(resourceID)
how can I get resourceID of a dynamically generated drawable.I am using this method :
Drawable d = Drawable.createFromPath("pathToImageFile");
to create a drawable.
Hi use the following method
by calling
Added in API level 1
EDIT: try this method