AndroidStudio 4说,从API 26开始,enterPictureInPicture已被弃用-这是不正确的,对吧?

问题描述

显示警告的AndroidStudio屏幕截图:

enter image description here

但是我发现here是:

Android 8.0 (API level 26) allows activities to launch in picture-in-picture (PIP) mode.
PIP is a special type of multi-window mode mostly used for video playback. It lets the
user watch a video in a small window pinned to a corner of the screen while navigating
between apps or browsing content on the main screen.

我无处可寻。我是否缺少某些东西或AS错误?我想确保我没有沿死路编码。

解决方法

enterPictureInPictureMode()是在API 24中引入的,而在API 26中已弃用。它已由API 26中引入的enterPictureInPictureMode(PictureInPictureParams)所取代。

此处的文档:https://developer.android.com/reference/android/app/Activity#enterPictureInPictureMode(android.app.PictureInPictureParams)