I\'m trying to set my root LinearLayout element (which is set to fill_parent in both dimensions) to have a background image which is always located in the lower left corner
If found an advantage doing this programatically: the image fits the layout instead of being bigger then it. No ideia why.
The code:
Bitmap bmp = BitmapFactory.decodeResource(getResources(),
R.drawable.image);
BitmapDrawable bitmapDrawable = new BitmapDrawable(bmp);
bitmapDrawable.setGravity(Gravity.BOTTOM|Gravity.RIGHT);
LinearLayout layout = (LinearLayout) findViewById(R.id.background_root);
layout.setBackgroundDrawable(bitmapDrawable);