Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old January 8th, 2012, 04:26 AM   #1 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Animation for button does'nt working

Hello,

I try add animation for button, I try use own, xml file

Quote:
<animation-list androidneshot="false" xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
</animation-list>
saved as catanim.xml
and use as setBackgroundResource(R.drawable.catanim);

That doesn't work

I try also code like here

Quote:
animation = new AnimationDrawable();
animation.addFrame(getResources().getDrawable(R.dr awable.cat), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.catakt), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.cat), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.catakt), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.cat), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.catakt), 3000);
animation.setOneShot(false);

animal1Button.setBackgroundDrawable(animation);
animation.setVisible(true, true);
animation.start();
And animation for button still doean't work on Emulator and Device (both with Android 2.1 / API 7)

Please help

sebasx is offline  
Reply With Quote
Sponsors
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:21 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo