Comment on Tutorial - Animation sample program in Android By Ashley



Comment Added by : Sin

Comment Added at : 2013-01-17 05:40:37

Comment on Tutorial : Animation sample program in Android By Ashley
In case your having trouble

1 the ani.xml file must be located in the res/layout directory not the drawable directory.

2 as mentioned earlier Change the line from
imgView.setBackgroundResource(R.drawable.ani);

to

imgView.setBackgroundResource(R.layout.ani);

3. in the ani.xml file you must have the drawable references in your drawable folder or the correct resolution display folder.

eg:

<item
android:drawable="@drawable/ic_launcher1"
android:duration="50" />
<item
android:drawable="@drawable/ic_launcher2"
android:duration="50" />
<item
android:drawable="@drawable/ic_launcher3"
android:duration="50" />

in this example i simply used the ic_launcher icon that by default is included in drawable-hdpi, drawable-mdpi, drawable-ldpi, folders and renamed them as ic_launcher_1,2,3 respectivley. And then copied them into the drawable folder...

you can use any png you want just make sure they are in the drawable folder and referenced in ani.xml

hope this makes sence...


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Hi Daniel,

Please suggest me, inste

View Tutorial          By: Pradeep at 2013-12-05 07:35:32

2. I do my projest in j2me.so please send me your ide
View Tutorial          By: sivasakthivel.s at 2011-06-22 13:26:54

3. good one
View Tutorial          By: vij at 2009-06-03 16:00:12

4. Hi ,Razvan

I changed code as in you

View Tutorial          By: sanil at 2011-01-01 11:05:53

5. Out of -1, 0, and 1 which one can I use as second
View Tutorial          By: Sanjay Bhosale at 2011-12-06 13:17:54

6. excellent, thanks a lot..............
View Tutorial          By: yellareddy at 2013-03-12 06:56:12

7. thanks,Gud job
View Tutorial          By: junaid sheikh at 2012-11-21 16:24:27

8. error :

Object reference not set to

View Tutorial          By: Ramnath at 2011-05-30 04:01:32

9. i have been trained in java stream. But i dont kno
View Tutorial          By: savio at 2013-01-23 10:15:51

10. I get this error:
Can someone please help m

View Tutorial          By: Carlos at 2010-06-14 02:42:53