繁体   English   中英

画中画时避免活动重新娱乐

[英]PiP avoid activity recreation when entering

在切换到图片窗口中的图片时,是否有避免活动重新进行的方法?

基本上我这样称呼它:

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

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

在文档中,将其添加到清单中的活动中:

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

详情请参阅https://developer.android.com/guide/topics/ui/picture-in-picture.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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