Code example for NfcManager

Methods: getDefaultAdapter

0
	{ 
		super.onResume(); 
		 
		// enable foreground dispatch for nfc 
		NfcManager manager = (NfcManager)getSystemService(Context.NFC_SERVICE);
		adapter = manager.getDefaultAdapter();
		adapter.enableForegroundDispatch(this, pendingIntent, intentFiltersArray, techList);
	} 
	 
	/** 
	 * onPause 
	 *  
	 * executed when this activity is paused. 
	 */ 
	@Override 
	protected void onPause()  
	{ 
		super.onPause(); 
		 
		// disable foreground dispatch for nfc 
		adapter.disableForegroundDispatch(this);