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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:42:30+00:00 2026-06-16T00:42:30+00:00

I am developing a tablet app. Everything is working fine until device is locked.

  • 0

I am developing a tablet app. Everything is working fine until device is locked. Once the device is locked and rotated, then the force close appears.

I forced my app to run on LANDSCAPE mode only. So I mentioned this permission in the menifest.

 <activity
            android:name=".activity.LoginActivity"
            android:screenOrientation="landscape"
            android:windowSoftInputMode="adjustPan" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

So when I am locking my device and its rotated then the orientation changed and this force close generated.

To resolve this, I added this permission in the menifest.

android:configChanges="orientation"

And in the code:

 @Override
    public void onConfigurationChanged(Configuration newConfig) {
        // TODO Auto-generated method stub
        super.onConfigurationChanged(newConfig);
        Log.i("Log", "Configuration changes called");
        int orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
        // or = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
        setRequestedOrientation(orientation);
    }

I have also added this line in the onCreate()

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i("Log", "OnCreate");
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        setContentView(R.layout.lyt_login_main);
                ........
                }

But still its not getting resolved. Please help me out to solve this issue.

This is the error I am getting:

12-17 11:13:57.877: E/AndroidRuntime(10462): FATAL EXCEPTION: main
12-17 11:13:57.877: E/AndroidRuntime(10462): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.marico.icp/com.marico.icp.activity.LoginActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f03000f
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3365)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread.access$700(ActivityThread.java:128)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1165)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.os.Handler.dispatchMessage(Handler.java:99)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.os.Looper.loop(Looper.java:137)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread.main(ActivityThread.java:4514)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at java.lang.reflect.Method.invokeNative(Native Method)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at java.lang.reflect.Method.invoke(Method.java:511)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at dalvik.system.NativeStart.main(Native Method)
12-17 11:13:57.877: E/AndroidRuntime(10462): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f03000f
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.content.res.Resources.getValue(Resources.java:1037)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.content.res.Resources.loadXmlResourceParser(Resources.java:2144)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.content.res.Resources.getLayout(Resources.java:870)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:273)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.Activity.setContentView(Activity.java:1835)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at com.marico.icp.activity.LoginActivity.onCreate(LoginActivity.java:77)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.Activity.performCreate(Activity.java:4465)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
12-17 11:13:57.877: E/AndroidRuntime(10462):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
12-17 11:13:57.877: E/AndroidRuntime(10462):    ... 12 more

Thanks in advance.

  • 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-16T00:42:30+00:00Added an answer on June 16, 2026 at 12:42 am

    As @kumar said in comment,

    I kept all the layout in the layout folder from layout-large-land, changed the menifest permission from
    android:configChanges="orientation" to android:configChanges="orientation|keyboardHidden"

    Commented this method onConfigurationChanged(), commented this line too setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    And then I run the code.
    this solved the issue of the force close, but due to orientation change, the onCreate() method called and and I was loosing the entered data into the editText,

    So for this I override the onSaveInstanceState(Bundle outState) method to my activity class. And did following.

    I was saving the entered data in the hashmap, so in the onSavedInstanceState(), i did this.

    @Override
        protected void onSaveInstanceState(Bundle outState) {
    
            outState.putSerializable("hashMap", hashMapSaveToDB);
            super.onSaveInstanceState(outState);
    
        }
    

    And in the onCreate() checked for the savedInstanceState like this…

    if(savedInstanceState != null)
            {
                hashMapSaveToDB = (HashMap<String, ArrayList<String>>) savedInstanceState.getSerializable("hashMap"); 
            }
    

    This solved the loosing of the data at the time of onCreate() called.

    Thanks to @kumar

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

Sidebar

Related Questions

I'm developing a tablet app on a Samsung Galaxy Tab 10.1 (Android 3.2). The
I'm developing HTML5 application for a tablet. Idea is as follows: app consists of
Disclaimer:It's my first time developing an app that will be on a tablet style
THE SETUP: Developing API 16 Android app with Eclipse and installing on Tablet when
I'm developing an Android 3.1 tablet application and I have a Fragment ( android.support.v4.app.Fragment
I'm developing an Android 3.1 Tablet application using android.support.v4.view.ViewPager and android.support.v4.app.FragmentActivity . The following
I am Developing an app for(honeycomb)tablet , want a full screen view.how to hide
I'm developing a Win8 JavaScript app for a tablet and implementing my own touch
I am developing a web app which runs on a (windows) tablet. I won't
I'm developing an app which should work on a phone and on a tablet

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.