【问题标题】:AndroidStudio 4 says enterPictureInPicture is depracated as of API 26 - this is incorrect, right?Android Studio 4 说从 API 26 开始不推荐使用 enterPictureInPicture - 这是不正确的,对吧?
【发布时间】:2020-12-22 21:20:16
【问题描述】:

显示警告的 AndroidStudio 屏幕截图:

但我发现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 有错误?我想确保我没有在死路上编码。

【问题讨论】:

    标签: android android-studio android-studio-4.0 android-picture-in-picture


    【解决方案1】:

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

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

    【讨论】:

    • 啊哈!谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-15
    • 1970-01-01
    • 2015-03-26
    相关资源
    最近更新 更多