Code example for NfcAdapter

Methods: disableForegroundDispatchdisableForegroundNdefPush

0
        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);
    } 
 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present. 
Stop searching for code, let great code find you!  Add Codota to your java IDE