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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:26:26+00:00 2026-06-02T16:26:26+00:00

My goal is to animate certain ListView items without having to worry about getView

  • 0

My goal is to animate certain ListView items without having to worry about getView messing with the animations by replacing list items with newly inflated ones in the custom ArrayAdapter.

If I use convertView to avoid inflating new items the order of the animations changes randomly.

Caching the views manually works fine but I doubt that it is a good solution. Better ideas?

  • 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-02T16:26:27+00:00Added an answer on June 2, 2026 at 4:26 pm

    What I do is to set animation at convertview and then I stop animation on each convertview. This way the animation is stopped and then played if the convertview is new and continue until end if it isn’t recycled before it ends.

    Edit I can’t seem to find an example so it will be partly pseudo code.

    In your adapter you’ll have something like following:

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        final ViewHolder holder;
    
        if(convertView == null) {
            // setup holder
            holder = new ViewHolder();
    
            LayoutInflater Inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = Inflater.inflate(mResourceId, null);
    
            holder.image = (ImageView) convertView.findViewById(R.id.row_image);
            holder.headline = (TextView) convertView.findViewById(R.id.row_headline);
    
            convertView.setTag(holder);
        } else {
            // get existing row view
            holder = (ViewHolder) convertView.getTag();
        }
        // GetView is only called on new items 
        // so now we stop the previous animation and start a new
        holder.animation.stop();  // First you stop the animation
        holder.animation = new animation();  // then you create new
        holder.animation.start();  // then you start the animation.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to animate my UI, and I am using UIView animations. The
Goal: from a list of vectors of equal length, create a matrix where each
My goal is to animate a JQuery menu to respond when hovered or clicked.
The ultimate goal is to have a div animate down when the button is
My simple goal is to fade animate hiding and showing functions. Button.hidden = YES;
I have a navigation based app. The root view is a list of items.
Goal: to programmatically determine the sizes (in bytes) of the fields of a class.
goal: I have the string 1234432144 I want to only replace the first 2
Goal Pass images generated by one process efficiently and at very high speed to
Goal To use a CREATE TYPE statement in HSQLDB 2.0.0 to create a user-defined

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.