NFC服务已死-尝试恢复 [英] NFC service dead - attempting to recover

查看:612
本文介绍了NFC服务已死-尝试恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个读取&将数据写入NFC标签(类型2). 有时在读取标签时,我在LogCat中收到以下错误.

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.

谢谢.

推荐答案

我遇到了同样的问题,并且能够解决. 当活动" 未处于恢复状态时,当您尝试调用NFC光束时会发生这种情况.

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检查当前活动是否处于恢复状态.如果当前活动未处于恢复状态,它将返回null对象并导致 NullPointerException DeadObjectException .

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.

这篇关于NFC服务已死-尝试恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆