Рисованная анимация - приложение перестает работать после добавления новой строки в список
Я работаю с Animation Drawable, чтобы создать что-то вроде истории для простой игры для Android. После нажатия кнопки "Пуск" появляется история с кнопкой пропуска. Все работает нормально, пока я не добавлю новую фотографию в список фотографий, представляющих сюжетную линию, все приложение перестанет работать и скажет: "К сожалению, приложение остановилось"
Вот мой XML-файл:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/selected" android:oneshot="true">
<item android:drawable="@drawable/homeone" android:duration="50" />
<item android:drawable="@drawable/hometwo" android:duration="50" />
<item android:drawable="@drawable/homethree" android:duration="50" />
<item android:drawable="@drawable/homefour" android:duration="50" />
<item android:drawable="@drawable/homefive" android:duration="50" />
<item android:drawable="@drawable/homesix" android:duration="50" />
<item android:drawable="@drawable/homeseven" android:duration="50" />
<item android:drawable="@drawable/tableone" android:duration="50" />
<item android:drawable="@drawable/tabletwo" android:duration="50" />
<item android:drawable="@drawable/tablethree" android:duration="50" />
<item android:drawable="@drawable/tablefour" android:duration="50" />
<item android:drawable="@drawable/tablefive" android:duration="50" />
<item android:drawable="@drawable/tablesix" android:duration="50" />
//After adding the last line "tablesix", the app stop working
</animation-list>
И вот мой файл Java:
package xx.tellme;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.ImageView;
public class StoryLine extends Activity{
ImageView story;
ImageButton skip;
AnimationDrawable anime;
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.stortlinelayout);
story = (ImageView) findViewById(R.id.imageView1);
skip = (ImageButton) findViewById(R.id.skipbut);
anime = new AnimationDrawable();
story.setBackgroundResource(R.drawable.dlist);
anime =(AnimationDrawable) story.getBackground();
anime.start();
skip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("xx.tellme.KAR"));
}
});
}
}
Что мне делать? или есть другой способ создать эту анимацию?