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. it is unfair to leave this portal without thanking
View Tutorial          By: anil kumar at 2009-12-30 23:40:25

2. can anyone send me how 2 sms from java code......<
View Tutorial          By: ramesh at 2009-02-07 04:26:06

3. it is very nice example of overloading when i read
View Tutorial          By: narendra saini at 2012-04-20 04:03:56

4. Nice Example .........than Q!!!
View Tutorial          By: Sreekar at 2011-06-29 15:31:50

5. Thanks so much!
View Tutorial          By: Viet at 2013-01-15 15:02:52

6. Very useful and simple.
Thanks.

View Tutorial          By: harsh at 2014-11-06 10:01:22

7. S.N. Constructor & Description
1 String

View Tutorial          By: Jameesh at 2015-03-05 07:09:38

8. Hi,
I am designing a client server multipla

View Tutorial          By: Varun Gupta at 2012-10-15 00:01:57

9. Thanks for everything... I'm greeting you from Aze
View Tutorial          By: Shahriyar at 2011-04-28 15:54:14

10. hi!! friends i executed the code
and i am

View Tutorial          By: chennareddy at 2007-10-15 00:07:30