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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:05:04+00:00 2026-05-26T03:05:04+00:00

Updated I have a problem with gradient bitmaps on android 2.3. I read this

  • 0

Updated
I have a problem with gradient bitmaps on android 2.3. I read this great article and decode my bitmaps using next options:

BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inDither = true;


And on android 2.2 everything is great, but on android 2.3 gradient artifacts remain even after that decoding.

I run application from article on 2.3 with my bitmaps and all variants are bad: 16/32 bit, (not) dither and RBG_565, ARGB_8888 and ARGB_4444 - gradient has artifacts. Also I tried to decode without options. Everything is ok. Sorry, problem was in

opts.inScaled=true;
opts.inDensity=100;
opts.inTargetDensity=800;


But now I need to make working this code on android 2.3 and its still produce bad gradient (on android 2.2 everything is ok):

    ImageView imageView = (ImageView) tabView.findViewById(R.id.tabsImage);
    // decode bitmaps
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inPreferredConfig = Bitmap.Config.ARGB_8888;
    options.inDither = true;
    Bitmap tabImageOn = BitmapFactory.decodeResource(mainActivity.getResources(), tabImageResourceOnId, options);
    Bitmap tabImageOff = BitmapFactory.decodeResource(mainActivity.getResources(), tabImageResourceOffId, options);
    // create new selector
    StateListDrawable tabImage = new StateListDrawable();
    tabImage.addState(new int[] { android.R.attr.state_selected }, new BitmapDrawable(mainActivity.getResources(), tabImageOn));
    tabImage.addState(new int[] {}, new BitmapDrawable(mainActivity.getResources(), tabImageOff));
    tabImage.setDither(true);
    // set selector to tab
    imageView.setImageDrawable(tabImage);


I tried to set window pixel format in onCreate/before/after that method next way:

    WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
    lp.copyFrom(getWindow().getAttributes());
    lp.format = PixelFormat.RGBA_8888;
    getWindow().setAttributes(lp);

But nothing has been changed (it's gingerbread, it's using 32 bit window format).

Why do so behaviour appear and how can i solve my problem?

Thanks. Good day!

  • 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-26T03:05:05+00:00Added an answer on May 26, 2026 at 3:05 am

    solved with moving drawables to hdpi folder.

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

Sidebar

Related Questions

I have a problem when trying to execute this update statement (below) using C#
I have a website that is updated regularly and I am having a problem
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
I have this code, but I have a problem. When I update but do
I have an interesting problem when using partial page update in asp.net with scriptmanager
I have a problem with django translations. Problem 1 - I updated string in
I have this problem for a long time now, I have searched the web
I have a problem updating the layout of my listbox using MVVM with Prism
I'm learning Android by writing a game and have a problem with the graphics
I have this problem on my payroll processing system. Below the area where the

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.