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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:32:53+00:00 2026-06-04T08:32:53+00:00

Good day, I have some problem with my GridView. public View getView(int position, View

  • 0

Good day, I have some problem with my GridView.

 public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imageView;


    if (convertView == null) {  // if it's not recycled, initialize some attributes
        imageView = new ImageView(mContext);
        imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setPadding(8, 8, 8, 8);
    } else {
        imageView = (ImageView) convertView;
    }


    imageView.setImageResource(mThumbIds[position]);
    if(LevelActivity.comp[position] == 1)
    { 
        imageView.setBackgroundResource(R.drawable.back_got);
        Bitmap btm;
        BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
        btm = drawable.getBitmap();
        btm = convertColorIntoBlackAndWhiteImage(btm);
    imageView.setImageBitmap(btm); 
    }

    return imageView;
}

Here’s code of my ImageAdapter, which set images in GridView. And if position of element is same to position in array with value of 1, it sets b&w image with special background instead of normal image. Everything works fine, BUT:
when I scroll my GridView, that special b&w images starts to “share” their backgrounds to images on their right. So after scrolling I get normal image with special background beside every special b&w element.

Hope you got an idea, thanks.

Image with problem: https://i.stack.imgur.com/Hbtwg.png

  • 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-04T08:32:54+00:00Added an answer on June 4, 2026 at 8:32 am

    Ok, I’ve got an answer. It is really similar to random-items-in-GridView problem. So all I’ve need to do is set background bitmap directly on canvas (inside b&w function).

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

Sidebar

Related Questions

Good day, I have run into some problem in the Zend_Cache_Frontend_Page. I want to
Good day, I have a parent gridview with a few columns. On each row,
Good day, I have the following problem: class B extends class A and methods
Good day everyone. I have been having the same problem all day at work
Good day everyone! I have a problem regarding my date. It needs to be
Good day to all, I have the following problem I have to convert the
Good day to all. I have the flowing problem. I have 2 domains. On
good day we are developing game for android and have some trouble with resource
Good day to all. I have a little problem. Can anyone tell me or
Good day everyone, I have a directory set up with some Apache Auth stuff.

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.