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. gr8 help dude thankx a lot:-)
View Tutorial          By: Mr. Bond at 2011-12-09 19:21:36

2. A big thanks to Ramlak for the detailed and crisp
View Tutorial          By: Chidanand Gangur at 2009-08-27 06:02:16

3. How to display the ARP Mapping Table of a given ho
View Tutorial          By: Hala at 2013-11-15 22:42:36

4. Thanks for the syntax, this has really helped me u
View Tutorial          By: Ketobbey at 2010-04-30 19:01:29

5. Hi
I need a javafx code which I
1

View Tutorial          By: HNO11 at 2011-03-26 08:59:03

6. Please some one send me the 6th program developed
View Tutorial          By: mounika at 2008-04-25 02:49:56

7. Hi I need code examples J2ME for chating aplicatio
View Tutorial          By: agus at 2010-04-03 04:16:11

8. Nice Intro to start J2Me
View Tutorial          By: Mak at 2009-07-04 10:36:00

9. I managed to run the code but I'm getting a *** ti
View Tutorial          By: Bull at 2012-01-11 12:26:57

10. good
View Tutorial          By: dock at 2013-06-07 15:18:49