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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:23:54+00:00 2026-06-11T19:23:54+00:00

Hi i am coding to set a Home Screen Wallpaper. It’s working fine. But

  • 0

Hi i am coding to set a Home Screen Wallpaper. It’s working fine. But my image pixel is totally damaged and then my wallpaper is not fit with the actual size of the home screen. I am try to workout different size of images. Unfortunately it’s not working for me. How to solve it.

My code is here

WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
Drawable drawable = getResources().getDrawable(R.drawable.newimage);
Bitmap wallpaper = ((BitmapDrawable) drawable).getBitmap();           
try 
{
    wallpaperManager.setBitmap(wallpaper);
} 
catch (IOException e) 
{
    e.printStackTrace();
}

My Screenshot Original Image
enter image description here

My Screenshot Android Emulator Home Screen
enter image description here

Why my original image is damaged here.
How to display My Original Image based on the Emulator Size.

  • 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-11T19:23:55+00:00Added an answer on June 11, 2026 at 7:23 pm

    You can try this:

    WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
    Drawable drawable = getResources().getDrawable(R.drawable.newimage);
    Bitmap wallpaper_source = ((BitmapDrawable) drawable).getBitmap();           
    try {
        int w = wallpaperManager.getDesiredMinimumWidth();
        int h = wallpaperManager.getDesiredMinimumHeight();
        int x = (w-wallpaper_source.getWidth())/2;
        int y = (h-wallpaper_source.getHeight())/2;
        Bitmap wallpaper = Bitmap.createBitmap(w, h, Config.ARGB_8888);
        Canvas c = new Canvas(wallpaper);
        c.drawBitmap(wallpaper_source, x,y, null);
        wallpaperManager.setBitmap(wallpaper);
    } 
    catch (IOException e) 
    {
        e.printStackTrace();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am coding in VS2008 with Resharper 4.5.1, but the projects are set to
Coding footer naively, if there's not enough content, then there will be empty space
After coding and testing a Java application (lets say with Eclipse, but not necessarily)
Can you tell me the best way to resize a home screen wallpaper using
Possible Duplicate: PHP session seemingly not working I'm currently coding my own CMS for
There exist tools for comparing code against a custom specified set of coding guidelines/standards
I know to set Typeface from coding like below. type1=Typeface.createFromAsset(getAssets(),fonts/helveticaneueLtstd-bd.otf); text.setTpeface(type1); But it is
I am coding a quiz module, which contains a radio button set, using jQuery
The coding like decimal prodprice = Convert.ToDecimal(NavigationContext.QueryString[Price]); then what should i put for Binary
I have a file in emacs with the buffer coding system set to no

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.