如何在弹出窗口期间保持方向?

发布于 2025-01-03 19:11:02 字数 126 浏览 2 评论 0原文

我在活动中使用菜单来显示弹出窗口。 问题是,当方向改变时,弹出窗口消失并再次显示活动屏幕。

(发生这种情况是因为当方向更改时,活动会再次启动)

我希望活动不会再次启动,并且在方向更改后,弹出窗口不会消失。

I am using menu in an activity to display a popup window.
The problem is that when the orientation is changed, the popup window disappears and the activity screen is shown again.

(It happens because when the orientation is changed the Activity is started again)

i want that the activity doesnt start again and after orientation change the popup window doesnt vannish.

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

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

发布评论

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

评论(2

天涯沦落人 2025-01-10 19:11:02

请在清单文件中查看活动
将活动放入代码下方

android:configChanges="orientation"

please chenge activity in manifest file
put in activity below code

android:configChanges="orientation"
完美的未来在梦里 2025-01-10 19:11:02

请对您定义活动的清单进行以下更改,

添加以下行:

android:screenOrientation="横向" 或
android:screenOrientation="肖像"

Please make the following changes to manifest where you defined your activity

add this lines:

android:screenOrientation="landscape" or
android:screenOrientation="portrait"

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