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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:41:52+00:00 2026-06-04T14:41:52+00:00

I have a class called PlayerList, in in that class i have an ArrayList

  • 0

I have a class called PlayerList, in in that class i have an ArrayList defined like this :

private ArrayList<Bitmap> images = new ArrayList<Bitmap>();

Now, an ArrayList remove method can exept 2 arguments, an index and an Object.

I’m trying to remove a Bitmap from the array by sending the Bitmap to it. The thing is the bit map is made of the same image but the instace of the Bitmap i saved in the array is not the same i’m trying to find, when i print the ArrayList to console i see new names all the time, stuff like :

[android.graphics.Bitmap@44ea2d48, android.graphics.Bitmap@44ea2e20]

Could this be related? and while wer’re at it, The class implements Parcelable so the data being read/writen back and forth, that can’t be too healthy too, right?

Am i missing a generic problem or it’s code specific and i should publish my code?

My problem here basiclly is when i try to remove the Bitmap, it allways removes the wrong item in the arraylist, always 1 before the 1 i need

  • 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-04T14:41:53+00:00Added an answer on June 4, 2026 at 2:41 pm

    Unless you have a handle to the BitMap's hash code or a like key based on which it is stored, you can’t remove a desired one from the list. If you just want to depend on BitMap stored, you need to traverse through the list and parse elements to find desired bitmap. Again you need a hascode to identify if the BitMap you are parsing is what you are looking for. Meaning you need to maintain a list of hashcode's for each of the BitMap stored. Alternatively use HashMap over List that allows to store a key against a BitMap being stored. And you can process your requirement based on the key and use it whenever required to remove a BitMap from the HashMap table.

    HashMap<String, BitMap> myBitMaps = ... // construct as you desire.
    ...
    if ( condition satisfied on key ) {
      myBitMaps.remove( keyObject );
      // process further
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class called MainGame, which is defined like this in my .h:
I have a class called Foo that has a function that looks like the
i have this class called MemoryManager, it is supposed to implement a simple smart
I have a class called Path for which there are defined about 10 methods,
I have a class called UserInfo that contains details about a given user. There
I have a class called Question that has a property called Type. Based on
I have this class called SiteAsyncDownload.cs Here's the code: public class SiteAsyncDownloader { WebClient
I have a class called MyClass This class inherits IEquatable and implements equals the
I have a class called Sprite, and ballSprite is an instance of that class.
I have a class called Image and a class that extends it called ImageSheet

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.