5

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.

ravi
  • 2,722
  • 7
  • 25
  • 42
  • 1
    Seems to be a problem of the available power in your Android device: http://stackoverflow.com/questions/6432796/android-nfc-issue-with-apdu-commands – pizzaani Mar 13 '14 at 11:30

1 Answers1

2

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.

BlackPearl
  • 31
  • 4