I have a problem with writing data to NFC card blocks I use standard mifare classic class for working with NFC. Everything works perfectly when Key A and Key B values are FFFFFFFFFFFFFF. But when I test this code with another key A and key B on other cards I've got TagLostException. I just change the value of keys.
android.nfc.TagLostException: Tag was lost.
at android.nfc.TransceiveResult.getResponseOrThrow(TransceiveResult.java:48)
at android.nfc.tech.BasicTagTechnology.transceive(BasicTagTechnology.java:151)
at android.nfc.tech.MifareClassic.writeBlock(MifareClassic.java:476)