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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:48:41+00:00 2026-06-11T13:48:41+00:00

ImageView something = (ImageView)findViewById(R.id.my_animated_image_view); something.setVisibility(View.INVISIBLE); ((AnimationDrawable)something.getDrawable()).stop(); // <– Is this line redundant? In my

  • 0

ImageView something = (ImageView)findViewById(R.id.my_animated_image_view);
something.setVisibility(View.INVISIBLE);
((AnimationDrawable)something.getDrawable()).stop(); // <-- Is this line redundant?

In my case, i have a bunch of animations of which only one runs/is visible, and right now I’m calling setVisibility() and stop() on all of them. Might get faster if i don’t need to call stop() on my own?

  • 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-11T13:48:43+00:00Added an answer on June 11, 2026 at 1:48 pm

    From AnimationDrawable source:

    @Override
        public boolean setVisible(boolean visible, boolean restart) {
            boolean changed = super.setVisible(visible, restart);
            if (visible) {
                if (changed || restart) {
                    setFrame(0, true, true);
                }
            } else {
                unscheduleSelf(this);
            }
            return changed;
        }
    

    So if you apply setVisible(false,false) to the AnimationDrawable then the animation will stop. But not when you apply it to the View. If you want the animation to go smooth then try AnimationDrawable.setVisible(false,false) and if you want your view Invisible don’t make it invisible cause a lot of UI stuff happens then. Try setting an Alpha animation ,make it transparent and setFillAfter(true). When the animations end call view to setVisibility(View.Invisible) where is needed. This probably with give you some FPS. But generally consider overall what UI stuff happen when you animate. Avoid GC calls and view invalidations

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

Sidebar

Related Questions

I've defined my layout something like this - ` <ImageView android:id=@+id/first_icon android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/square
I have a vew, received by: (ImageView) findViewById(R.id.photo) That view currently has a bitmap
I have this ImageView in my layout: <ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:contentDescription=@string/image_divider android:paddingBottom=8dp android:paddingTop=4dp android:scaleType=fitXY
if ([cell.imageView.image isEqual:[UIImage imageNamed:@1.png]]) { // Do something 1 } else { // Do
Is it possible to achieve something like this: I have one picture to set
I have a local sqlite database file that looks something like this… _ID |
I am trying to set up something where the IBAction from view controller 1
===EDIT=== Is there a reason something like this doesn't work i feel like it
I have this View Adapter method for a ListView which is populated from a
ImageView is defined in class named Third - (void)viewDidLoad { // Displays UIImageView UIImageView*

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.