Code example for NfcAdapter

Methods: enableForegroundDispatch

0
    } 
 
    @Override 
    public void onResume() { 
        super.onResume(); 
        if (mAdapter != null) mAdapter.enableForegroundDispatch(this, mPendingIntent, mFilters,
                mTechLists);
    } 
 
    @Override 
    public void onNewIntent(Intent intent) {
        Log.i("Foreground dispatch", "Discovered tag with intent: " + intent);
        mText.setText("Discovered tag " + ++mCount + " with intent: " + intent);
    } 
 
    @Override 
    public void onPause() { 
        super.onPause(); 
        if (mAdapter != null) mAdapter.disableForegroundDispatch(this);
    } 
}