有人能解释一下可以传递给回调的错误消息吗?

public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode)

我以前见过错误代码3,但不知道它是什么意思。文档看起来最多也就是一片一片的…
干杯,

最佳答案

有同样的问题,并从nsdmanager来源得到了答案:

/**
 * Failures are passed with {@link RegistrationListener#onRegistrationFailed},
 * {@link RegistrationListener#onUnregistrationFailed},
 * {@link DiscoveryListener#onStartDiscoveryFailed},
 * {@link DiscoveryListener#onStopDiscoveryFailed} or {@link ResolveListener#onResolveFailed}.
 *
 * Indicates that the operation failed due to an internal error.
 */
public static final int FAILURE_INTERNAL_ERROR               = 0;

/**
 * Indicates that the operation failed because it is already active.
 */
public static final int FAILURE_ALREADY_ACTIVE              = 3;

/**
 * Indicates that the operation failed because the maximum outstanding
 * requests from the applications have reached.
 */
public static final int FAILURE_MAX_LIMIT                   = 4;

编辑:
实际上,开发人员文档中提到:
http://developer.android.com/reference/android/net/nsd/NsdManager.html

10-07 19:23
查看更多