Code example for NfcAdapter

Methods: enableForegroundDispatchenableForegroundNdefPush

0
        } 
        return msgs;
    } 
 
    private void enableNdefExchangeMode() { 
        mAdapter.enableForegroundNdefPush(MainActivity.this, getNoteAsNdef());
        mAdapter.enableForegroundDispatch(this, mNfcPendingIntent, mNdefExchangeFilters, null);
    } 
     
    private void disableNdefExchangeMode() { 
        mAdapter.disableForegroundNdefPush(this);
        mAdapter.disableForegroundDispatch(this);
    } 
     
    @Override 
    protected void onPause() { 
        super.onPause(); 
        mResumed = false;
        mAdapter.disableForegroundNdefPush(this);
    } 
Stop searching for code, let great code find you!  Add Codota to your java IDE