NFC NdefFormatable class connect () lanza IOException

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.

preguntado el 12 de junio de 14 a las 11:06

invalid operation for unregister MVA with VA(0x54f66000) size(466560) -

todo log please -

Is the exception thrown upon connect() or format()? Is your tag still in range when you exectue that code? In what thread (I.e. how do you create it?) do you execute that code? -

exception is on on connect() , i have separate thread for its execution... and its already in doInBackground(). -

You might want to try manual creation of a worker thread instead of using an AsyncTask then. See esta pregunta for a problem that sounds very similar. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.