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. In good form, don't forget to add column headers a
View Tutorial          By: Jake at 2009-07-13 14:20:16

2. excellent, thanks a lot..............
View Tutorial          By: yellareddy at 2013-03-12 06:56:12

3. it is Marvelous example.
View Tutorial          By: princevijayakumar at 2010-08-04 07:56:33

4. Hi...Really nice post..But i got the error like
View Tutorial          By: Nithya at 2013-04-11 09:37:50

5. i want to study java
View Tutorial          By: doshyo at 2007-12-13 07:41:03

6. Hi,
i am using crystal report 9. Once i ins

View Tutorial          By: jeff at 2012-02-12 08:14:15

7. Hi lolz,
In order for this code to work, yo

View Tutorial          By: Vijay at 2008-12-10 19:22:04

8. farhaan, thats why I said, "Using the HTML Bu
View Tutorial          By: Charles at 2008-03-21 01:36:46

9. 'Numbers' is the name of his table, you need to su
View Tutorial          By: Amir at 2010-09-15 10:59:20

10. </application>
<uses-permission an

View Tutorial          By: saurabh at 2012-01-17 05:00:21