Skip to content Skip to sidebar Skip to footer

Animationdrawable Error On Button Click

I believe my xml is correct, but I'm not sure what's causing this error in my code. I am trying to attempt animationdrawable on an imagebutton, but each time I click my button I ge

Solution 1:

2 things:

  1. Change your drawable (remove selector tag):

<animation-listxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/selected"android:oneshot="true"><itemandroid:drawable="@drawable/musicon1"android:duration="50" /><itemandroid:drawable="@drawable/musicon2"android:duration="50" /><itemandroid:drawable="@drawable/musicon3"android:duration="50" /><itemandroid:drawable="@drawable/musicon4"android:duration="50" /><itemandroid:drawable="@drawable/musicon5"android:duration="50" /></animation-list>
  1. I can't see you setting the background of the musicEnable_ImageButton, you're only trying to get it... Am I missing something, or are you just forgetting to set the background in the first place?

Post a Comment for "Animationdrawable Error On Button Click"