I have an application which reads & writes the data into the NFC tag(Type 2). Some times while reading the tag i am getting the below error in LogCat.
03-13 12:26:12.946: E/NFC(18889): NFC service dead - attempting to recover
03-13 12:26:12.946: E/NFC(18889): android.os.DeadObjectException
03-13 12:26:12.946: E/NFC(18889): at android.os.BinderProxy.transact(Native Method)
03-13 12:26:12.946: E/NFC(18889): at android.nfc.INfcAdapter$Stub$Proxy.setForegroundDispatch(INfcAdapter.java:350)
03-13 12:26:12.946: E/NFC(18889): at android.nfc.NfcAdapter.disableForegroundDispatchInternal(NfcAdapter.java:1062)
03-13 12:26:12.946: E/NFC(18889): at android.nfc.NfcAdapter.disableForegroundDispatch(NfcAdapter.java:1050)
Does any have any idea why is this happening. Is there any way to fix this.
Thanks.
I have come across the same issue and was able to resolve. This happens when you try to invoke NFC beam, when Activity is not in Resumed State.
NFCBeamShareData checks if the current activity is in resume state. If the current activity is not in resume state, it will return null object and causes NullPointerException or DeadObjectException.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With