Code example for NfcAdapter

Methods: setNdefPushMessageCallback, setOnNdefPushCompleteCallback

0
		if(mNfcAdapter == null){
			Log.d("TAG", "nfc adapter is null");
		} 
		else{ 
			// Register callback to set NDEF message 
			mNfcAdapter.setNdefPushMessageCallback(this, activity);
             
            // Register callback to listen for message-sent success 
            mNfcAdapter.setOnNdefPushCompleteCallback(this, activity);
		} 
		 
		 
	} 
	 
	public void setUI(TextView tv){
		mTv = tv;
	}  
	 
	public NdefMessage createNdefMessage(NfcEvent event) {
		 
		String key = KeyFileOperator.readKey(mContext);