gpt4 book ai didi

android - PiP进入时避免 Activity 娱乐

转载 作者:行者123 更新时间:2023-11-29 19:01:58 25 4
gpt4 key购买 nike

有没有办法避免在切换到画中画窗口时 Activity 重新启动?

基本上我是这样调用它的:

@Override
protected void onUserLeaveHint() {
if (Build.VERSION.SDK_INT > 24 && isInFullscreen) {
MainActivity.this.enterPictureInPictureMode();
}
super.onUserLeaveHint();
}

Activity 总是重新加载,这导致等待时间更长。

最佳答案

来自文档 - 将此添加到 list 中的 Activity :

android:resizeableActivity="true"
android:supportsPictureInPicture="true"
android:configChanges=
"screenSize|smallestScreenSize|screenLayout|orientation"

参见 https://developer.android.com/guide/topics/ui/picture-in-picture.html更多详情

关于android - PiP进入时避免 Activity 娱乐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48708359/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com