【发布时间】:2012-07-19 22:31:54
【问题描述】:
我正在尝试使用Android developer link 中提到的createApplicationRecord(packagename) 将应用程序记录添加到我的NdefMessage 中,但我看到一个错误:
方法 createApplicationRecord(String) 未定义类型 NdefRecord
我已经从 Eclipse 更新了我的 Android SDK 管理器。以下是部分代码:
private NdefMessage getMessageAsNdef() {
byte[] textBytes = mInfo.getBytes();
NdefRecord textRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA,
"text/plain".getBytes(), new byte[] {}, textBytes);
return new NdefMessage(new NdefRecord[] { textRecord, NdefRecord.createApplicationRecord("com.nfcgeo.mypackage") });
}
【问题讨论】:
标签: android nfc ndef android-applicationrecord