}
private void writeCustomTag(String target_uri) {
Utilities.log("XXXX Writing Custom tag");
NDEFTagConnection tagConnection = null;
String content = (String) _tag_attrs.get(Constants.TAG_ATTRIBUTE_CONTENT);
String domain = (String) _tag_attrs.get(Constants.TAG_ATTRIBUTE_DOMAIN);
String type = (String) _tag_attrs.get(Constants.TAG_ATTRIBUTE_TYPE);
Utilities.log("XXXX domain:" + domain);
Utilities.log("XXXX type:" + type);
Utilities.log("XXXX content:" + content);
try {
NDEFMessage externalNdefMessage = NDEFMessageUtils.createExternalTypeMessage(domain, type,
content.getBytes("US-ASCII"));
tagConnection = (NDEFTagConnection) Connector.open(target_uri);
tagConnection.write(externalNdefMessage);
Utilities.log("XXXX NfcWriteNdefSmartTagListener Custom Tag written successfully");
_screen.logEvent("Custom Tag written successfully");
} catch(Exception e) {
_screen.logEvent(e.getClass().getName() + ":" + e.getMessage());
Utilities.log("XXXX " + e.getClass().getName() + ":" + e.getMessage());