I have downloaded an image at runtime. Now I want to set it as a background for RelativeLayout
. Does it possible?
Check out the setBackgroundDrawable, or maybe createFromPath in the Drawable class.
RelativeLayout rLayout = (RelativeLayout) findViewById (R.id.rLayout);
Resources res = getResources(); //resource handle
Drawable drawable = res.getDrawable(R.drawable.newImage); //new Image that was added to the res folder
rLayout.setBackground(drawable);