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. how to solve this problem

javax.com

View Tutorial          By: bhamre sandeep at 2010-02-28 04:18:36

2. This will give the output check it out


View Tutorial          By: shruthi at 2013-01-18 06:00:08

3. ..i have a question. is it possible to override a
View Tutorial          By: rein at 2010-08-25 07:07:15

4. I'm working on an intranet site/web application. W
View Tutorial          By: Tony Gingrich at 2011-10-23 21:22:31

5. Hi can anyone tell me how to use try catch in comm
View Tutorial          By: Gossip Lanka at 2015-04-26 05:00:44

6. I run the code . It's good.
View Tutorial          By: Golam Rabbi at 2011-07-12 07:06:00

7. wow........thanks a lot :)
View Tutorial          By: shiva at 2015-08-11 07:47:08

8. It is very Important Site
View Tutorial          By: Shridhar Koli at 2011-12-29 11:43:29

9. Thanks Man!! Been searching for a simple one like
View Tutorial          By: Kid at 2012-10-12 14:15:43

10. hello, this code was compiled correctly, bt it wil
View Tutorial          By: anand vijay singh at 2014-05-03 12:47:24