title: Creating a frame animation in android
body: <p>Hi im trying to set up a frame animation with a series of images as a background for my splash page in an android application, I would if possible like the code to run on start up. I have been writing the code but get an error that says "frame animation cannot be resolved". </p>
  
  <p>The java code I have implemented in my main activity is as follows:</p>
  
  <pre><code>@Override
      public void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          ImageView frameanimation = (ImageView) findViewById(R.id.frame_animation);
          AnimationDrawable frame_animation = (AnimationDrawable) frameanimation.getBackground();
  
          frame_animation.setVisible(true, true);
          frame_animation.start();
      }
  </code></pre>
  
  <p>I then have this code implementing an image view within my XML Layout file:</p>
  
  <pre><code>&lt;ImageView
          android:id="@+id/frame_animation"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:src="@drawable/frame_animation" /&gt;
  </code></pre>
  
  <p>and finally I have my animation drawable saved as 'frame_animation.xml' within my drawable folder.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"&gt;
      &lt;item android:drawable="@drawable/homebckgrnda1" android:duration="200" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda2" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda3" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda4" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda5" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda6" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda7" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda8" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda9" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda10" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda11" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda12" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda13" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda14" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda15" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda16" android:duration="50" /&gt;
      &lt;item android:drawable="@drawable/homebckgrnda17" android:duration="50" /&gt;
  &lt;/animation-list&gt;
  </code></pre>
  
  <p>Any help is much appreciated, I just cannot figure out what is going wrong.</p>
  
  <p>Thanks</p>