I'm trying to figure out how to make a simple animation using png's in my drawable folder. When the user clicks on an button, an animation happens on that button. I want to have it run a little animation cycling through some pics.
I have the following as XML but am unclear on the java
<?xml version="1.0" encoding="utf-8"?>
<item android:drawable="@drawable/laptopblue" android:duration="200" />
<item android:drawable="@drawable/laptopred" android:duration="200" />
<item android:drawable="@drawable/laptopyellow" android:duration="200" />
I'm having an error with the code I'm using to identify the animation. It force closes.
myAnimation = AnimationUtils.loadAnimation(this, R.anim.myanimation);
Is onDraw or a Timer needed, or will it just work based on he duration set in the XML? I'm just not sure what objects and methods are needed to make it work.