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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:16:42+00:00 2026-05-23T13:16:42+00:00

EDIT-Moderator, feel free to delete this question. The problem lay in my background image

  • 0

EDIT-Moderator, feel free to delete this question. The problem lay in my background image size, and not the actual orientation change.


Please bear with me- I do not believe this question/problem has been answered in this simple of terms.

I have an application with several activities and 2 layout resources for each with the same name for the XML files, stored in res/layout-land and res/layout-port.

The issue is that when I start the application on a Nexus One (I am using Android 2.3) the application starts with no issues, but if I try to rotate the screen (change the orientation), it crashes. To clarify, if I start the Activity holding the phone landscape style, the application shows me the res/layout-land resource layout, and vice versa, but if I try to change the orientation at runtime, it crashes.

I believe that if there are 2 XML layouts, saved in -port and -land folders then Android should destroy the activity and recreate it with the other layout by the same name, correct?

Here is my manifest, and I am happy to paste in some more code if necessary.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="dominion.game"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="9" />
    <application android:icon="@drawable/icon" android:label="@string/app_name" debuggable="true">
        <activity android:name="dominion.game.DominionMenu"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="dominion.game.CreateMenu"
                  android:label="@string/app_name">
        </activity>
        <activity android:name="dominion.game.AdvancedMenu"
                  android:label="@string/app_name">
        </activity>
        <activity android:name="dominion.game.ShuffleResult"
                  android:label="@string/app_name">
        </activity>
    </application>
</manifest>

Here is the beginning of the onCreate method:

      @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mainmenu);
    //...Lots of onClick listeners for the 4 buttons...
    }

The rest of it is action listeners, and if each button is clicked, it starts an intent to another activity. The mainmenu layout corresponds to res/layout-land/mainmenu & res/layout-port/mainmenu, at least in theory.

I looked at the DDMS errors, but nothing has a link to somewhere in my code where there is an error.

EDIT: error log on request (all of the red stuff until the force close)-

07-01 00:23:41.082: ERROR/dalvikvm-heap(11182): 9864000-byte external allocation too large for this process.
07-01 00:23:41.109: ERROR/GraphicsJNI(11182): VM won't let us allocate 9864000 bytes
07-01 00:23:41.109: DEBUG/dalvikvm(11182): GC_FOR_MALLOC freed <1K, 52% free 2598K/5379K, external 19819K/19819K, paused 15ms
07-01 00:23:41.117: DEBUG/AndroidRuntime(11182): Shutting down VM
07-01 00:23:41.117: WARN/dalvikvm(11182): threadid=1: thread exiting with uncaught exception (group=0x40015560)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182): FATAL EXCEPTION: main
07-01 00:23:41.128: ERROR/AndroidRuntime(11182): java.lang.RuntimeException: Unable to start activity ComponentInfo{dominion.game/dominion.game.DominionMenu}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2796)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread.access$1600(ActivityThread.java:117)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:932)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.os.Looper.loop(Looper.java:123)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread.main(ActivityThread.java:3647)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at java.lang.reflect.Method.invokeNative(Native Method)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at java.lang.reflect.Method.invoke(Method.java:507)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at dalvik.system.NativeStart.main(Native Method)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.Activity.setContentView(Activity.java:1657)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at dominion.game.DominionMenu.onCreate(DominionMenu.java:28)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     ... 12 more
07-01 00:23:41.128: ERROR/AndroidRuntime(11182): Caused by: java.lang.reflect.InvocationTargetException
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at java.lang.reflect.Constructor.constructNative(Native Method)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     ... 22 more
07-01 00:23:41.128: ERROR/AndroidRuntime(11182): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.Bitmap.nativeCreate(Native Method)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.Bitmap.createBitmap(Bitmap.java:444)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:349)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:463)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:326)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.content.res.Resources.loadDrawable(Resources.java:1709)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.View.<init>(View.java:1951)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.View.<init>(View.java:1899)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.view.ViewGroup.<init>(ViewGroup.java:286)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     at android.widget.LinearLayout.<init>(LinearLayout.java:120)
07-01 00:23:41.128: ERROR/AndroidRuntime(11182):     ... 25 more
07-01 00:23:41.144: WARN/ActivityManager(113):   Force finishing activity dominion.game/.DominionMenu

In essence, my question is: What are the steps needed to take in order for automatic screen orientation changes to work? I thought I did them all…

Any help or suggestions are much appreciated, thanks in advance!


@Rahul Sharma-
That stopped the crashing, but instead of switching to the other layout, it just uses the same layout in the different orientation.

@Asynkronos
I’m on 2.3 not 2.1 but that is an interesting bug to consider, certainly. I don’t think I’m using those objects though.

OK- you guys are gonna be annoyed, but the problem was that my background image was enormous- like close to 30in x 30in. So I scaled it down to about 7×7 in inches, and there is no issue…

  • 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-23T13:16:42+00:00Added an answer on May 23, 2026 at 1:16 pm

    Was happening on my app aswell, check that activities arent being created on Orientation change or something. Its to do with the activity lifecycle for sure

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

Sidebar

Related Questions

Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This question is more about language engineering than C++ itself. I used C++
EDIT: I just realized that this question may be better suited to ServerFault. Instead
EDIT: upgraded this question to MVC 2.0 With asp.net MVC 2.0 is there an
Edit: This is technically a 2 part question. I've chosen the best answer that
EDIT: had to retag this, because, it's rather a Sweave / R question since
Edit : updating generalized question to reflect actual domain: sport of hockey. The actual
Edit: From another question I provided an answer that has links to a lot
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business

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.