Set lock screen background in Android (like Spotify do)

前端 未结 6 769
旧巷少年郎
旧巷少年郎 2020-12-02 12:31

I know that this topic has been already discussed here, here and here, and the answer seems to be that it is not possible.

But I recently installed Spotify in my Ne

6条回答
  •  北海茫月
    2020-12-02 13:23

    as explained here the key is to to pass a MediaMetadata object to your MediaSession. If these terms seems alien to you it's best to start the linked tutorial from the top.

    I found the .putBitmap(MediaMetadata.METADATA_KEY_ART, bitmap) line to be the one that is taken to load the image to the lockscreen background. But be sure to populate .putBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART, bitmap)as well.

提交回复
热议问题