¡@

Home 

2014/10/16 ¤W¤È 08:12:19

android Programming Glossary: desiredstate

How can I enable NFC reader via API?

http://stackoverflow.com/questions/6509316/how-can-i-enable-nfc-reader-via-api

Relevant source public boolean onPreferenceChange Preference preference Object value Turn NFC on off final boolean desiredState Boolean value mCheckbox.setEnabled false Start async update of the NFC adapter state as the API is unfortunately blocking..... as the API is unfortunately blocking... new Thread toggleNFC public void run Log.d TAG Setting NFC enabled state to desiredState boolean success false if desiredState success mNfcAdapter.enable else success mNfcAdapter.disable if success Log.d.. new Thread toggleNFC public void run Log.d TAG Setting NFC enabled state to desiredState boolean success false if desiredState success mNfcAdapter.enable else success mNfcAdapter.disable if success Log.d TAG Successfully changed NFC enabled..