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. Hello, I have a problem
I cant understand s

View Tutorial          By: henry at 2012-01-10 07:53:05

2. Thank you for such a article. It is extreamly nice
View Tutorial          By: Ravi at 2011-08-23 10:04:14

3. Oh, Thanks for your code, but I think you should a
View Tutorial          By: Songokute at 2013-01-29 13:55:13

4. Good piece of information explained wonderfully. !
View Tutorial          By: Juzar at 2009-07-23 00:24:40

5. i am new to SMS, i think i need a device too. Whic
View Tutorial          By: Usman at 2015-10-05 12:06:34

6. hai, i tried the abvoe code, m getting the follwin
View Tutorial          By: anith at 2011-03-13 06:02:31

7. This is really a tremendous tutorials for the begi
View Tutorial          By: Raghvendra Dwivedi at 2010-09-01 10:22:42

8. Nice example to understand what does the string To
View Tutorial          By: Spha at 2011-07-14 08:00:03

9. Sir , I am doing MSc(swe) . I want to know more ab
View Tutorial          By: guru prakash at 2009-10-15 09:10:05

10. tnx .
View Tutorial          By: smokes at 2009-04-15 07:30:19