You need to actually assign the values you read to your variable set
:
Change
prefs.getStringSet(PREF_DEVICES, set);
to
set = prefs.getStringSet(PREF_DEVICES, set);
The second parameter is the default value which is an empty HashSet
in your case (you can leave it this way or change to an appropriate default value).