What's the difference setting background image in layout xml and setting it from the code?
<p>What's the difference between setting background image in layout xml and setting it from the code? Does setting image from code use more memory?</p>

<p>For example:</p>

<p>In XML:</p>

<pre><code>&lt;ImageView android:id="@+id/background"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background_img" /&gt;
</code></pre>

<p>From the code:</p>

<pre><code>((ImageView)findViewById(R.id.background)).setBackgroundResource(R.drawable.background_img);
</code></pre>

<p>Thanks.</p>
