NFC-based Android application that starts after the download is complete (when the event BOOT_COMPLETEDreceived by BroadcastReceiver).
Problem
Several times NfcAdapter.getDefaultAdapter(this)retunrs null; it is random / inconsistent, for some load cycles it works fine and returns NfcAdapter, and for other load cycles this method returns null.
I suspect that when it returns null, the NFC service is not already running, or the NFC service is not fully running at the time of the BOOT_COMPLETEDBroadcasted event .
Question
Is there a way to make sure the NFC service is up and running before the event BOOT_COMPLETEDis broadcast?
Assuming the device is rooted, will it help if init.rcchanged? If so, what is customization if anyone has encountered such a problem?
source
share