I have a linearLayout as the main layout in my android xml file. The background is set to "@drawable/window_background_red". Inside the activity (at run time) I want to set this to "@drawable/window_background_green".
window_background_green.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:type="linear"
android:startColor="#000000"
android:endColor="#004400"
android:angle="-90"
/>
</shape>
</item>
</selector>