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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:46:10+00:00 2026-05-21T06:46:10+00:00

I have an app developed for a Droid (phone). In the app, I use:

  • 0

I have an app developed for a Droid (phone). In the app, I use:

Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.bg);

To set the background bitmap in the application. The bitmap is sized 480×800
which is the WVGA screen size of the Droid (without status or title bar).

Two questions:
When I rotate the phone, the Droid goes into landscape mode and the background no longer fits correctly. How do I tell the App it needs to use landscape mode when I’m not using a layout?

Second, when I run this app on the Xoom, it picks the mdpi drawable which is nowhere near the size of the Xoom screen. How do I define a second mdpi drawable that has a 1280×800 size? I think if I were using layouts, I would create a layout-xlarge directory and place a 1280×800 background in the imageview of that layout, correct?

Thanks!

Update *:
Thanks for the great answers! I upvoted everyone.
I updated the code to use drawable-xlarge-port/drawable-xlarge-land for the Xoom and drawable-port-mdpi/drawable-land-mdpi for the Droid.

I’m not using layouts as I needed to draw directly onto the activity canvas and not sure how to use setContentView() from within the class where I extend View and hook into onDraw() in order to do the animation (would need to be a separate posting).

If I can figure out how to rotate the image myself I could indeed do away with the drawable-*-land and *-port directories.

  • 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-21T06:46:11+00:00Added an answer on May 21, 2026 at 6:46 am

    You can target drawables, not just layouts. You want drawable-hdpi-large-long-land for the first situation (assuming you’re letting the system handle rotation events and recreate your activity), and drawable-mdpi-xlarge for the second.

    Of course it’s futile to try to ship with a separate image for every conceivable phone resolution; partially because there’s a lot you’d need, and partially because some targets aren’t differentiable (the 854×480 and 800×480 phones out there are all hdpi-large-long, for example, despite the 54px difference). Try to use a scaleable image, a stretchable 9patch, or an image you can just fix at the top-right corner (you can define stretch behaviors using an XML-defined bitmapdrawable).

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

Sidebar

Related Questions

I have an MVC2 app I developed with the VS2010 RC and the .NET
i have developed an app which executes sql jobs. When I click on execute
I have developed an app that in testing has worked fine but when it
I have developed my app in android 2.2, and put it on google market
I have developed my app using core data. It works fine in the simulator.
I have developed my app for tablet. Now I need to convert it to
I have current a developed app which I am going to submit in just
I have a nice clean domain layer in my app that was developed in
I have a bit of a weird problem. I developed an app with MVC
I have enrolled in the iOS developer's program. I've developed an app which I

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.