android - 如何阻止 Android Spotify Remote SDK 自动断开连接?(颤振应用)
问题描述
每次我让应用程序闲置一段时间,spotify 远程都会自动断开连接。我不确定这实际上是一件事还是只是 Flutter,但我需要它运行,直到我告诉它停止运行。
每次都会抛出此消息:
来自 Spotify 的消息:[6,{"message":"应用服务停止"},"wamp.error.system_shutdown"]
一旦我尝试再次播放,遥控器无法连接。我检查了 Spotify 遥控器是否为空或是否已断开连接,但看起来两者都不是:
if (mSpotifyAppRemote == null) {
System.out.println("[player state]: remote is null");
activateSpotifyRemote(arguments);
} else if (!mSpotifyAppRemote.isConnected()) {
System.out.println("[player state]: remote is not connected");
activateSpotifyRemote(arguments);
} else {
// always goes down to here, but nothing happens after message.
handleSpotifyPlayerAPI(arguments);
}
解决方案
推荐阅读
- terraform - 无法通过 terraform 为 Azure 虚拟机设置动态 IP
- types - f# 表达式的类型
- kotlin - 下面代码的 reader.next()[0] 行中 [0] 的作用是什么
- c - 为了让我的 C 程序更加用户友好,需要进行哪些更改?
- c# - 不支持 WCF 服务操作类型
- javascript - Nodejs,如何在同一行显示和更新文本,例如运行时钟或下载速度?
- perl - 我可以用perl中的子类比较来调用超类排序吗?
- qt - 如果在 QWidget 中创建 QQuickWidget,则 Qt qml 崩溃
- html - 如何创建包含 4 个部分的页面布局?
- kubernetes - kubernetes Pod 的 readinessProbe 出错但端点未从服务中删除