I can\'t resolve one service while another is being resolved? If that\'s what the error means... What is the way to wait until it is resolved?
@Override
public v
You don't have to wait! If you look at the javadocs for resolveService(NsdServiceInfo serviceInfo, NsdManager.ResolveListener listener) here you'll notice that for the parameter listener it say's "to receive callback upon success or failure. Cannot be null. Cannot be in use for an active service resolution."
Therefore in order for this to work just do the following:
mNsdManager.resolveService(service, new MyResolveListener());
Where MyResolveListener is:
private class MyResolveListener implements NsdManager.ResolveListener {
@Override
public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {
//your code
}
@Override
public void onServiceResolved(NsdServiceInfo serviceInfo) {
//your code
}
}
hope this helps :)