How to set view as image background in android?
<p>I am try to set image background . I am creating a View that's background color is red .</p>

<p>All view and set image background programmatically .</p>

<p>this is my code </p>

<pre><code>    final View trans_View = new ImageView(MyClass.this);
    ImageView img = (ImageView)findViewById(R.id.img);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                                100, 100);
                        params.setMargins(10, 2, 10, 2);
                        trans_View.setBackgroundColor(Color.RED);
                        trans_View.setLayoutParams(params);
</code></pre>

<p><strong>img.setBackground   View ????</strong></p>

<p>example-
Actual image :
<img src="http://i.stack.imgur.com/ANtpl.png" alt="enter image description here"></p>

<p>when i select Image then display below output.</p>

<p><img src="http://i.stack.imgur.com/xOolj.png" alt="enter image description here"> </p>

<p>I don't know how to set view as image background .</p>

<p>Please help me...</p>
