Code example for NfcAdapter

Methods: setNdefPushMessageCallback, setOnNdefPushCompleteCallback

0
		if (nfcAdapter == null) {
			Toast.makeText(context, "NFC is not available on this device. :(", Toast.LENGTH_LONG).show();
			return;  // NFC not available on this device 
		} 
		 
		nfcAdapter.setNdefPushMessageCallback(this, sourceActivity);
		nfcAdapter.setOnNdefPushCompleteCallback(this, sourceActivity);
	} 
	 
	/** 
	 * Convert a serializable object  
	 * @param object 
	 * @return 
	 * @throws IOException 
	 */ 
	private byte[] serializeObject(Object object) throws IOException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutput out = null;
		byte[] serialized;
		try { 
			out = new ObjectOutputStream(bos);