Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:12:10+00:00 2026-06-10T20:12:10+00:00

I am looking at the documentation for animation-list and the XML layout is straight

  • 0

I am looking at the documentation for animation-list and the XML layout is straight forward, but I am confused how they deal with it in the code.

In that page they have something like:

ImageView img = (ImageView)findViewById(R.id.spinning_wheel_image);
 img.setBackgroundResource(R.drawable.spin_animation);

 // Get the background, which has been compiled to an AnimationDrawable object.
 AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();

 // Start the animation (looped playback by default).
 frameAnimation.start();

But they never reference spinning_wheel_image anywhere in the XML they show, nor the spin_animation ….the id for the spin snippet in their examples is “selected”

So I am wondering where those two references come from? And why the actual id of the XML snippet which is “selected” is never used?

Thanks!

EDIT:

I put my animations xml into a file called animation.xml

And in the code now I have this:

ImageView img = (ImageView)findViewById(R.id.spinning_wheel_image);
        img.setBackgroundResource(R.drawable.animation);

        // Get the background, which has been compiled to an AnimationDrawable object.
        AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();

        // Start the animation (looped playback by default).
        frameAnimation.start();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:12:11+00:00Added an answer on June 10, 2026 at 8:12 pm

    But they never reference spinning_wheel_image anywhere in the xml they show

    spinning_wheel_image is the ID of an ImageView, presumably from a layout resource used with setContentView() or a LayoutInflater.

    nor the spin_animation ….the id for the spin snippet in their examples is “selected”

    That is presumably a typo — there is no android:id for AnimationDrawable. At least, it is not in the documentation. The name of an animation resource is based on the filename, and the filename is spin_animation .xml.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been scouring the internet looking for documentation that gives a list of acceptable strings
Looking into Kohana documentation, i found this really usefull function that they use to
I'm looking for documentation on C++ code for file and directory implementation into C++
Looking through the documentation for CFDataRef I can't see anything that will compress a
I'm looking for documentation and information about the Blackberry OS and Blackberry Api but
I've been looking for documentation for cocos2d-x but it seems to be really really
There is documentation for DWR exception handling for Client side: http://directwebremoting.org/dwr/documentation/browser/errors.html But I'm looking
Looking at the documentation , there is LinearLayout.addView() but there isn't any LinearLayout.replaceView(). On
I tried looking for documentation but it is quite sparse. I wrote the following
I'm looking through the documentation for the YouTube API and they talk about statistics

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.