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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:29+00:00 2026-05-27T04:38:29+00:00

In the API demo , there is an example of an effecient list adapter

  • 0

In the API demo , there is an example of an effecient list adapter in which all the bitmap are preloaded in the adapter constructor :

// Icons bound to the rows.
mIcon1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon48x48_1);
mIcon2 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon48x48_2);

In case the adapter have to deals with a lot of bitmap, is it still a good practice or will it be better to do something like that in the getView :

holder.myImage.setImageDrawable(context.getResources().getDrawable(R.drawable.icon48x48_1));

Note in my case , i can have something like 10-15 possible bitmap , but only a few will be used at same time. I’m concerned by the memory used by the adapter.

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-05-27T04:38:29+00:00Added an answer on May 27, 2026 at 4:38 am

    If the icons are truly 48×48 pixels, they won’t be that big, and since you have a known small set of them, preloading them is probably fine. I would not use that approach if:

    • the images are massive, or
    • the images are being loaded from places other than resources, or
    • there would be more than a few dozen icon-sized images

    You can always dump your heap from DDMS and inspect it with the Eclipse MAT plug-in to get a perspective on how much heap space is actually being used. Test it on Honeycomb or Ice Cream Sandwich, though, as you get better results for tracking bitmap heap consumption.

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

Sidebar

Related Questions

I am developing a demo application using Last.FM API which will get list of
I'm trying out the LoaderCursor example in the API Demo: package com.example.android.apis.app; import android.app.Activity;
I am using adsense Management API and followed everything there to generate a demo
I am using Twitterizer API for accessing twitter related functionality. I have one demo
from fabric.api import sudo, put, run def install(): run('source /home/user/.virtualenvs/demo/bin/activate') run('pip install requests') if
I have started to try out to use the new Search API, the demo
API in my example returns id, name pair <categories> <category id=5 name=Bollywood/> <category id=484
Which API can tell me the information about if LED is supported by a
I have this code which tries to get the demo data from Hindi language
I have built off of the google api MapView demo. I've extended the MapView

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.