简体   繁体   中英

Android Emulator force closes when overriding screen orientation

I have an app where all activities have the orientation overritten to be portrait.

This is what a random activity declaration looks like on the Manifest:

<activity
    android:configChanges="orientation|keyboardHidden"
    android:label="@string/app_name"
    android:name=".activities.LeaderboardActivity"
    android:screenOrientation="portrait" >
</activity>

There's nothing else changed for that matter on the LeaderboardActivity.java.

That code runs just fine on my phone, but when I loaded up the emulator to get some screen shots, it keeps sending me the following error:

"The application Android keyboard (process com.android.inputmethod.latin) has stopped unexpectedly. Please try again"

When I click "Force close", nothing happens, the app keeps running but the error pops up again in less than 10sec, making it impossible to do anything.

Has someone else experienced that kind of problem before?

And it's not a specific problem with my emulator, because all members of my team are getting the same error on their pcs, but not on their phones.

EDIT: My friend told me he encountered this same problem, and resolved it by opening the AVD manually before starting the app, and only call the app when it's fully loaded. I still haven't tried that, I'll update this when I test this method.

Why are you using android:configChanges="orientation|keyboardHidden" since you are forcing android to stay on portrait orientation? Maybe that's the problem.. did you tried to get it off?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM