i've got a problem: The AnimationDrawable in my app works perfectly on my Nexus 4 (Android 4.4.2) but on my Samsung Galaxy S3 (4.1.2) mini it doesn't start. Anyone there who knows how to solve that problem?
Greetings Nils
My Java code:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final AnimationDrawable ad = (AnimationDrawable) getResources().getDrawable(R.drawable.ad);
ad.run();
}
the AnimationDrawable xml-file:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/image_1" android:duration="150" />
<item android:drawable="@drawable/image_2" android:duration="150" />
<item android:drawable="@drawable/image_3" android:duration="150" />
<item android:drawable="@drawable/image_4" android:duration="500" />
</animation-list>