I am currently using Android Network Service Discovery. With the function below, each time it runs, it returns one host name. However, I want to store all data somewhere to pass to the next activity, how will I be able to that?
public void onServiceFound(NsdServiceInfo service) {
Log.d(TAG, "Service discovery success" + service.getServiceName());
if (!service.getServiceType().equals(SERVICE_TYPE)) {
Log.d(TAG, "Unknown Service Type: " + service.getServiceType());
} else if (service.getServiceName().equals(mServiceName)) {
Log.d(TAG, "Same machine: " + mServiceName);
} else if (service.getServiceName().contains(mServiceName)){
mNsdManager.resolveService(service, mResolveListener);
}
}
Example I have 3 names to store, how would I be able to do that?