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

  • SEARCH
  • Home
  • 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 8563807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:03:02+00:00 2026-06-11T17:03:02+00:00

I am in a situation where I want to display animation from dynamic list

  • 0

I am in a situation where I want to display animation from dynamic list of images. I want to use AnimationDrawable for this purpose, but unfortunately I am stuck… 🙁 my code is as

ImageView globe = (ImageView) findViewById(R.id.globe);

AnimationDrawable animation = new AnimationDrawable();
animation.setOneShot(true);

Resources res = this.getResources();

while (from <= to) {
    String name = "globe_" + String.format("%03d", from);
    int globeId = res.getIdentifier(name, "drawable",
            this.getPackageName());
    animation.addFrame(res.getDrawable(globeId), 200);
    from++;
}

globe.setBackgroundDrawable(animation);
globe.post(new Runnable(){
        @Override
        public void run() {
            animation.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-11T17:03:03+00:00Added an answer on June 11, 2026 at 5:03 pm

    I just did animation.start() after the loop and called the function from a runnable and it worked

    while (from <= to) {
        String name = "globe_" + String.format("%03d", from);
        int globeId = res.getIdentifier(name, "drawable",
                this.getPackageName());
    
        animation.addFrame(res.getDrawable(globeId), 200);
        from++;
    }
    
    globe.setBackgroundDrawable(animation);
    
    animation.start()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this situation where I want to display a list of Administration objects
I have a situation where i want to return List<> from this function public
The situation: On server A we want to display content from server B in
I have a situation where i want to add LinePragmas to CodeDom objects. But
This seems like a classic rails situation: I want to have a my index
I have the following situation where I want to only display the search results
I want to display a prompt message when he is redirceted from a special
I want to build a contact list in js, but there are so many
This code is used to get a specific list of ID's from one table,
I have a situation where I want to order a column from the highest

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.