构建错误 Bind_Listener 已弃用
Build error Bind_Listener is deprecated
当我尝试构建我的 apk 时,它给我一个错误
Error:(190) Error: The com.google.android.gms.wearable.BIND_LISTENER
action is deprecated.
这是我的 AndroidManifest 现在的样子
<service
android:name=".MyDeviceListenerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action
android:name="com.google.android.gms.wearable.BIND_LISTENER"/>
</intent-filter>
</service
自 Play Services 8.2 起,Bind_Listener 已被弃用。
较新的方法是使用细粒度的 intent 过滤器 API,方法是仅指定您希望收到通知的事件。
要始终从应用程序获取消息,请将 Bind_Listener
更改为类似这样的内容
<service
android:name=".MyDeviceListenerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
<data android:scheme="wear" android:host="*" android:pathPrefix="/request-network" />
</intent-filter>
</service>
您可以在 documentation 上阅读更多相关信息。
当我尝试构建我的 apk 时,它给我一个错误
Error:(190) Error: The com.google.android.gms.wearable.BIND_LISTENER action is deprecated.
这是我的 AndroidManifest 现在的样子
<service
android:name=".MyDeviceListenerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action
android:name="com.google.android.gms.wearable.BIND_LISTENER"/>
</intent-filter>
</service
自 Play Services 8.2 起,Bind_Listener 已被弃用。
较新的方法是使用细粒度的 intent 过滤器 API,方法是仅指定您希望收到通知的事件。
要始终从应用程序获取消息,请将 Bind_Listener
更改为类似这样的内容
<service
android:name=".MyDeviceListenerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
<data android:scheme="wear" android:host="*" android:pathPrefix="/request-network" />
</intent-filter>
</service>
您可以在 documentation 上阅读更多相关信息。