java - Cannot invoke getRecords(int) on the array type -
i cannot seem past error no matter try - i've tried removing int values (as seems should) leads more compiler errors.
any suggestions?
void processintent(intent intent) { parcelable[] rawmsgs = intent.getparcelablearrayextra( nfcadapter.extra_ndef_messages); // 1 message sent during beam ndefmessage[] msg = new ndefmessage[rawmsgs.length]; (int = 0; < msg.length; i++) { msg[i] = (ndefmessage) rawmsgs[i]; // record 0 contains mime type, record 1 aar, if present beammsg.settext(new string(msg.getrecords(1).getpayload())); beammsg2.settext(new string(msg.getrecords(1).getpayload())); }}
from quick glance @ documentation located here appears syntax off.
to reference specific record index code should following
msg.getrecords()[1].getpayload()
although there logic error , should calling msg[i]
so
msg[i].getrecords()[1].getpayload()
Comments
Post a Comment