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



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. Your code is syntactically correct, but semantical
View Tutorial          By: mobinga at 2011-07-25 15:08:27

2. Hi.

Mi question is more simple. I w

View Tutorial          By: David at 2010-10-03 04:59:09

3. I want to use the same code in c++,
Can a

View Tutorial          By: vijay at 2009-09-26 00:47:02

4. how come its able to copy from copyFrom to CopyTo.
View Tutorial          By: sameera at 2015-09-12 13:56:29

5. could anyone run this program on Netbean? If there
View Tutorial          By: Wei Long at 2008-06-16 19:23:48

6. i need help for my study, i need an algorithm for
View Tutorial          By: Vincent at 2011-08-17 13:37:52

7. The Given Programms are not suitable for "How
View Tutorial          By: Rams at 2009-01-27 01:36:16

8. write a program to prepare the student marks for s
View Tutorial          By: belgreen frodo at 2015-03-31 05:41:05

9. hi the code is working fine till step5 and am gett
View Tutorial          By: raj at 2008-09-16 22:55:40

10. On my blog (http://www.future-edge.nl/blog/adding-
View Tutorial          By: Robert Willems at 2011-11-29 06:26:21