Code example for NfcAdapter

Methods: disableForegroundDispatch, disableForegroundNdefPush

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. 
        getMenuInflater().inflate(R.menu.main, menu);