title: flashing background
body: <p>I have a <code>LinearLayout</code> with a few <code>Buttons</code> and <code>TextViews</code>. I want my background to flash at timed intervals, say from red to white to red and so on.  Right now, I am trying this code, but it gives me a null pointer exception. </p>
  
  <pre><code>LinearLayout ll = (LinearLayout) findViewById(R.layout.activity_main);
  Animation anim = new AlphaAnimation(0.0f, 1.0f);
  anim.setDuration(50); 
  anim.setStartOffset(20);
  anim.setRepeatMode(Animation.REVERSE);
  anim.setRepeatCount(Animation.INFINITE);
  ll.startAnimation(anim); // shows null pointer exception at this line
  </code></pre>
  
  <p>Please help me where am I going wrong? </p>