侦听器已在使用中(服务发现)
2022-09-03 03:36:48
我无法解析一个服务,而另一个服务正在解析?如果这就是错误的含义...等待解决的方法是什么?
@Override
public void onServiceFound(NsdServiceInfo service) {
Log.d(TAG, "Service found. " + service);
if (service.getServiceType().equals(SERVICE_TYPE)) {
if (service.getServiceName().contains(mServiceName)) {
mNsdManager.resolveService(service, mResolveListener);
}
}
}
java.lang.IllegalArgumentException: listener 已经在 android.net.nsd.NsdManager.resolveService(NsdManager.java:613) at com.example.miguel.broadcast.LocalService$2.onServiceFound(LocalService.java:145)