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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:17:07+00:00 2026-06-17T03:17:07+00:00

This is my setup. I have a custom ListView with some fancy headers, which

  • 0

This is my setup. I have a custom ListView with some fancy headers, which is inside a ViewPager. I’m maintaining a memory cache of images that having been downloaded and stored locally like any self-respecting developer would.

The issue I’m having is that everytime I call setImageBitmap(Bitmap bm) on the ImageView in my ListView‘s getView() method, using a Bitmap from the cache, it’s causing my all Views to onMeasure(). I’ve looked through the Android ImageView source code and found this:

public void setImageDrawable(Drawable drawable) {
    if (mDrawable != drawable) {
        mResource = 0;
        mUri = null;

        int oldWidth = mDrawableWidth;
        int oldHeight = mDrawableHeight;

        updateDrawable(drawable);

        if (oldWidth != mDrawableWidth || oldHeight != mDrawableHeight) {
            requestLayout();
        }
        invalidate();
    }
}

So I can see that setImageDrawable (which is called by setImageBitmap) requests its layout whenever the drawable has differing dimensions than its previous Drawable. The problem is that my ImageView is set static to 60dp x 60dp, so its size isn’t going to change regardless of the size of its image.

Is there a way I can get around the layouts being constantly remeasured as I scroll? The onMeasure and onLayout calls are propagating their way up the View tree, so my ListView and ViewPager are also getting measured in the middle of the list scrolling, which is obviously causing serious performance issues (~100ms UI jumps).

The performance is awful and I need to correct it. Anyone have any solutions?

Thanks.

  • 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-17T03:17:09+00:00Added an answer on June 17, 2026 at 3:17 am

    It has been a while but I have a similar issue recently, one row in my listview’s height changed too much, causing the listview.onmeasure called.

    If you are build against API-14 and above, you can set breakpoint in the SDK source code. that should help to figure out why height is changed.

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

Sidebar

Related Questions

Is it possible to have nested set capabilities in this somewhat custom setup? Consider
I have this following setup, a textarea named with some data in it that
I have a setup with sections in a UITableView which all have a custom
I have created a custom button using this code setup : function(ed) { ed.addButton('Tittle',
I have this setup in my models: class Author(models.Model): name = models.CharField(max_length=100) class Topic(models.Model):
On my portfolio page I have this setup: <div id=portfolio> <ul id=sites> <li> <h3><a
I have a setup like this: http://jsfiddle.net/zzjSC/3/ and I am wondering why the surrounding
I have a setup like this: <div id=container> <div id=close>Close</div> </div> Then in my
I have a setup like this. var element = $(.module-panel, this.el); $('.module-panel:not('+element+')').hide(); What I'm
I have setup my windows in a certain way. How do I save this

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.