Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android Studio中的PNG序列动画_Java_Android_Animation - Fatal编程技术网

Java Android Studio中的PNG序列动画

Java Android Studio中的PNG序列动画,java,android,animation,Java,Android,Animation,所以我目前在oncreate中有这段代码。我真的很想创建一个动画,只要用户打开应用程序使用png序列 public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_home); view = (ImageView) findViewById(R.id.imageAnimation); view.setBackgroundResource(R.drawable.anima

所以我目前在oncreate中有这段代码。我真的很想创建一个动画,只要用户打开应用程序使用png序列

public void onCreate(Bundle savedInstanceState) {
    setContentView(R.layout.activity_home);
    view = (ImageView) findViewById(R.id.imageAnimation);
    view.setBackgroundResource(R.drawable.animation_list_filling);
    frameAnimation = (AnimationDrawable) view.getBackground();

我已经创建了一个xml文件

   <?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">

    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00000"/>

    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00001"/>

    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00002"/>

...
    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00043"/>
</animation-list>

...

但一旦我运行应用程序,它就会不断崩溃。Android Studio当前没有错误。

Karla Romero您能给我发送您的崩溃日志吗
   <?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">

    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00000"/>

    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00001"/>

    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00002"/>

...
    <item
        android:duration="100"
        android:drawable="@drawable/tugs_00043"/>
</animation-list>