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. Program is good and easy to understand
View Tutorial          By: sravs at 2011-05-16 00:45:05

2. this text is overlapping the existing text what if
View Tutorial          By: Alda at 2015-10-02 18:22:22

3. This article is very clear,short and direct to the
View Tutorial          By: N JIBRIN at 2007-03-15 11:48:26

4. its work well , thanks for code , but if any body
View Tutorial          By: mary at 2007-12-16 07:10:58

5. I executed your code but i get the error "OK
View Tutorial          By: Denzil at 2013-01-18 09:33:37

6. Thanks a lot lot lot for this... u saved me...
View Tutorial          By: Sourabh Idoorkar at 2011-06-10 04:25:10

7. ' REFERENCIA EN EL PROYECTO (Microsoft Excel 12.0
View Tutorial          By: Anonymous at 2015-04-21 03:10:41

8. its show objects are not equal
View Tutorial          By: Amit at 2012-12-22 14:56:29

9. When copying this code into my java IDE, should i
View Tutorial          By: Barabas at 2010-02-11 03:57:09

10. my question is the same of sajjad.what about (!iss
View Tutorial          By: hossain at 2012-04-26 04:28:56