NdefFormatable ndefFormatable = NdefFormatable.get(tag);
if (ndefFormatable == null) {
throw new TagException("Not a NDEF formatable tag");
}
try {
if(!ndefFormatable.isConnected())
{
ndefFormatable.connect();
}
tagData.setUniqueId(tag.getId());
NdefMessage ndefMessage = buildNdefMessage(tagData);
ndefFormatable.format(ndefMessage);
}
catch (FormatException ex) {
throw new TagException(ex.getMessage());
}
finally {
ndefFormatable.close();
}
When it goes into the try and execute connect() it always throws IOException
can any one help me out.