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. Article is good but really lacks somewhat clarity
View Tutorial          By: Ashwin Perti at 2009-09-14 04:02:39

2. It is clear and understandable for beginners.

View Tutorial          By: Archana at 2011-12-14 12:31:21

3. Hi,

Your COM port is currently in u

View Tutorial          By: Ramlak at 2008-04-14 07:29:55

4. hi..it's very nice..can you send me the version fo
View Tutorial          By: daniel81 at 2010-02-11 09:19:36

5. what about strings in J2ME ?
View Tutorial          By: Swapnil at 2012-07-20 09:19:15

6. Hi mounika, Did you download and install the javac
View Tutorial          By: Ramlak at 2008-04-27 05:49:42

7. what about asp.net?
View Tutorial          By: tradeready at 2009-05-06 03:04:20

8. Thanks Thanks Thanks.....for you
But how

View Tutorial          By: jihad at 2009-02-15 04:48:53

9. Excellent information reg the scopes of jsp , plea
View Tutorial          By: venkateshwarreddy suravaram at 2012-01-09 08:34:23

10. What about object bean with view scope?
View Tutorial          By: Awo at 2012-02-11 12:17:36