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 8715323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:49:07+00:00 2026-06-13T05:49:07+00:00

I have an ImageView that is being used to show some frame animation. The

  • 0

I have an ImageView that is being used to show some frame animation.
The Duration for these images are all set to 100.

However, the ImageView needs to be hidden sometimes. So the animation is stopped and the ImageView is set to GONE.

When it’s time to show the ImageView again, its visibility is set to VISIBLE and the animation is started.

HOWEVER – now the animation is really fast; instead of a duration of 100, it looks like 50. But when I check the duration it still says 100 – but it definitely doesn’t look like it.

The code to hide and show the ImageView is as follows:

    //hide the animation
    final AnimationDrawable frameAnim = (AnimationDrawable) animImgView.getBackground();
    if (frameAnim.isRunning() == true)
    {
        frameAnim.stop();
    }

    frameAnim.setVisible(false, false);
    animImgView.setVisibility(View.GONE);




    //show animation
    animImgView.setVisibility(View.VISIBLE);

    final AnimationDrawable frameAnim = (AnimationDrawable) animImgView.getBackground();
    frameAnim.setVisible(true, true);
    frameAnim.start();

What could be the trouble ?

  • 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-13T05:49:08+00:00Added an answer on June 13, 2026 at 5:49 am

    After some experimentation I found that the best way is to simply implement:

    //hide the animation
    animImgView.setVisibility(View.GONE);
    
    
    //show animation
    animImgView.setVisibility(View.VISIBLE);
    

    this will preserve the animation speed. My original intent with the animation stop/start was to ensure the CPU wasn’t doing more than was needed.

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

Sidebar

Related Questions

I have an ImageView that is 250dp above the bottom and with translate animation
I have a ImageView and draw some things on that view. Now I want
I have used ImageView's before and understand the different scale types that can be
If i have an ImageView that fills the screen. The ImageView background is set
I currently have an imageview element that upon being touched, that tests if the
I have an application that uses a flip-book style animation with thousands of images.
I have an app with a layout that loads some remote images. When the
I have an ImageView that I am animating using a TranslateAnimation. At the end
I have an ImageView in my activity that shows an active symbol when a
I have a scrollview (IBOutlet); in that scrollview I have added an imageview. I

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.