より多くの画像を使用してアニメーションを行う必要があります。そのため、フレームごとのアニメーションを使用しています。しかし、私は直面していjava.lang.OutOfMemoryError: bitmap size exceeds VM budget
ます。インターネットで調べましたが、さっぱりわかりません。誰でも私を助けてください。
以下のコードを使用してみました:
アクティビティ.java
scr1.setBackgroundResource(R.drawable.data9);
AnimationDrawable frameAnimation9 = (AnimationDrawable)scr1.getBackground();
frameAnimation9.start();
frameAnimation9.setOneShot(true);
data9.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/s1" android:duration="100" />
<item android:drawable="@drawable/s3" android:duration="100" />
<item android:drawable="@drawable/s5" android:duration="100" />
<item android:drawable="@drawable/s6" android:duration="100" />
</animation-list>