Reputation: 732
XML code
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- another items -->
<item>
<Bitmap android:src="@drawable/drawable_by_argument"/>
</item>
</layer-list>
In code above i want to set Bitmap android:src attribute dynamicaly by some argument. Something like:
Java code
getResources().getDrawable(R.drawable.back, R.drawable.some_img);
Is it possible. If yes how can i do it.
Thanks for help.
Upvotes: 0
Views: 450
Reputation: 39856
no. it's not possible.
XML is not dynamic, it's static and heavy parsed during compiling time.
Upvotes: 1