I am learning android and its difficult to sperate UI and logic in android as it recommends xml way. I am trying to learn it . I need help in changing background

I have two image in my layout. One is HUD will be at the left and other will be bg 
There are many bg's but right now I have just put one .I need help how to change this bg's as user will click on some button.

In my main1.xml - There are 8 buttons as user will click on button respective to that bg has to come in the main2.xml

Here is the code for main2.xml 

```
<?xml version="1.0" encoding="utf-8"?>
<!-- Horizontal Layout for HUD and Level Screen -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="horizontal" >

    <!-- Vertical Layout for the HUD which includes Object list,Timer, Pause and Menu Button -->

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="@drawable/hud"
        android:orientation="vertical" >
    </LinearLayout>

    <!-- Relative Layout for the Level Screen -->

    <RelativeLayout
        android:id="@+id/GamePlayScreen"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:background="@drawable/bg" >                 
    </RelativeLayout>

</LinearLayout>

```

This works for one bg how to keep same layout main2.xml and keep on changin bg w.r.t to button click