Android 模拟器在覆盖屏幕方向时强制关闭

发布于 2024-12-20 00:50:10 字数 814 浏览 6 评论 0原文

我有一个应用程序,其中所有活动的方向都被覆盖为纵向。

这就是清单上随机活动声明的样子:

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

LeaderboardActivity.java 上没有任何其他更改。

该代码在我的手机上运行得很好,但是当我加载模拟器以获取一些屏幕截图时,它不断向我发送以下错误:

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

当我单击“强制关闭”时,没有任何反应,应用程序继续运行,但弹出错误不到10秒又再次发生,让人无法做任何事情。

以前有其他人遇到过这样的问题吗?

这不是我的模拟器的具体问题,因为我团队的所有成员都在他们的电脑上遇到相同的错误,但在手机上却没有。

编辑: 我的朋友告诉我他也遇到了同样的问题,并通过在启动应用程序之前手动打开 AVD 并仅在应用程序完全加载时调用应用程序来解决该问题。我还没有尝试过,当我测试这个方法时我会更新这个。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天气好吗我好吗 2024-12-27 00:50:10

既然你强制 android 保持纵向方向,为什么要使用 android:configChanges="orientation|keyboardHidden" ?也许这就是问题所在..您尝试过将其取下吗?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文