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 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

Is there anyway to get a list of mutual friends using Facebook's Graph API?
Reflection API is great thing out there to manipulate the OOP stuff and looks
Using the Windows API, how can I get a list of domains on my
Is there any API to get the currently logged in user's name and password
I have built off of the google api MapView demo. I've extended the MapView
I'm trying to authenticate to the Flickr API for a demo application I want
Is there a demo somewhere how to use Datatables 1.7.x with ASP.NET MVC 2
I'm writing demo code for an API we've created and I keep running into
The Android SDK has an API demo for using the preview of the camera.
Hi I am unable to uninstall the API Demos app which got installed when

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.