title: Android Layout background alpha
body: <p>Hi I have a layout which I'm using to fill my page and I have to set a background image held in my <code>drawable folder</code> in that layout.</p>
  
  <p>I want to then set the <code>alpha value</code> of the image to something quite low almost make the image like a water mark.</p>
  
  <p>my xml looks like </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/background"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
  android:background="@drawable/main_background" &gt;
  </code></pre>
  
  <p>As you can see I have assigned an id to the layout</p>
  
  <p>I thought in my oncreate I could do something like this?</p>
  
  <pre><code>View backgroundimage = (View) findViewById(R.id.background);
  backgroundimage.setAlpha(80);
  </code></pre>
  
  <p>This is not working however I suspect its because I'm trying to cast the background as a <code>View</code> what should I cast it as? </p>