Is it possible to auto resize a background image applied to any view say a LinearLayout? I am trying to achieve this but the background image does not resize according to the size of LinearLayout.This is a problem because a slight change in resolution will make things look messy. Here is how i added my background to LinearLayout
    Resources res = getResources();
    Drawable d= res.getDrawable(R.drawable.bImg);
    LinearLayout encloser=(LinearLayout) findViewById(R.id.wrap);
    LinearLayout ll = new LinearLayout(this);
    ll.setOrientation(LinearLayout.VERTICAL);
    ll.setId(1);
    ll.setBackground(d);
    encloser.addView(ll);