Как запустить анимацию в onCreate () в Android?

Я сделал, как это не работает?

public class AnimationActivity extends Activity{
            private AnimationDrawable yourAnimation; 
            @Override
            protected void onCreate(Bundle savedInstanceState) {
                // TODO Auto-generated method stub
                super.onCreate(savedInstanceState);
                setContentView(R.layout.animation);  
                getIntentValues();
                final ImageView imageView = (ImageView) findViewById(R.id.animation_iv);   
                imageView.setBackgroundResource(R.drawable.loadinganim);   
                yourAnimation = (AnimationDrawable) imageView.getBackground(); 
                yourAnimation.start();
    }

Рез \ вытяжка \ loading.xml

<?xml version="1.0" encoding="utf-8"?> 
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"  
    android:oneshot="false">  
    <item android:drawable="@drawable/v1" android:duration="160" />  
    <item android:drawable="@drawable/v4" android:duration="160" />  
    <item android:drawable="@drawable/v7" android:duration="160" />  
    <item android:drawable="@drawable/v8" android:duration="160" />  
    <item android:drawable="@drawable/v9" android:duration="160" />  
    <item android:drawable="@drawable/v10" android:duration="160" />  
    <item android:drawable="@drawable/v11" android:duration="160" />  
   </animation-list>

Рез \ расположение \ animation.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="fill_parent" 
 android:layout_height="fill_parent" 
    >
<ImageView 
 android:id="@+id/animation_iv"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent" 
 />

Анимация начинается в imageView onClick (). Если у кого-нибудь есть идея, помогите мне.

Ответы на вопрос(5)

Ваш ответ на вопрос